PDA

View Full Version : استفاده از اکسس 2007



y.saied
سه شنبه 14 خرداد 1387, 00:09 صبح
سلام دوستان عزیز
امکان استفاده از اکسس 2007 تو vb هست یانه ......... خواهشناً زودتر جواب بدین

a_mohammadi_m
پنج شنبه 06 تیر 1387, 10:26 صبح
با سلام
براي VB فرقي نمي كنه بانك شما چي باشه فقط بايد در VB سرويس پك 6 رو نصب كرده باشي تا بتوني از Provider هاي جديد بانكهاي اطلاعاتي كه مورد نياز ADO Data Control هست استفاده كني

berjiss
جمعه 14 تیر 1387, 16:28 عصر
در ویژوال فرقی وجود نداره؟ چه بسا که از اکسس 2007 استفاده کنی یا 2000 مهم اونه که ویژوال 6 رو داشته باشی!!!!

a_mohammadi_m
سه شنبه 22 بهمن 1387, 18:09 عصر
با سلام
ببخشيد كه من نبودم كه زود جواب بدم
ولي باز هم ميگم كه براي VB6 فرقي نداره بانك شما چيه فقط بايد Provider مخصوص اون رو داشته باشيد
مثلا اگر SP6 رو براي VB6 نصب كرده باشيد خواهيد ديد كه بسياري از انواع بانكها رو مي شناسه حتي اونايي رو كه شايد اسمش رو هم نشنيديد

با تشكر

Morteza_Nooh
دوشنبه 10 فروردین 1388, 14:11 عصر
اگر از VB.net استفاده می کنی از مثال زیر میتونی استفاده کنی :
ابتدا یک دیتابیس در آدرس D:\access\try.mdb ایجاد کن
درون دیتابیس یک table به نام try ایجاد کن
فیلدهای درون try عبارتند از idno,name,designation. idno=auto number
کنترل های روی فرم عبارتند از :
textBoxes=TxtName,TxtDesignation
Combobox=CboRetrieve
buttons=new,save,retrieve,exit
یک module به نام ModMain ایجاد کن
کد زیر را نوشه و اجرا کن


Module ModMain
Public Const OLEDB_CONNECTION_STRING As String = _
"Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking Mode=0;Jet OLEDB:Database Password=soumya;Data Source=D:\access\try.mdb;Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global Bulk Transactions=1;Provider=Microsoft.Jet.OLEDB.4.0;Je t OLEDB:System database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Share Deny None;Jet OLEDB:New Database Password=;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False"
'"Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking Mode=0;Data Source=D:\access\try.mdb ;Mode=Share Deny None;Jet OLEDB:Engine Type=5;Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:System database=;Jet OLEDB:SFP=False;persist security info=False;Extended Properties=;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;User ID=Admin;Jet OLEDB:Global Bulk Transactions=1"


'"workstation id=USER21;packet size=4096;integrated security=SSPI;data source=USER12;persist security info=False;initial catalog=Northwind"

Public Const ConnectionString As String = OLEDB_CONNECTION_STRING
Public mode As Boolean
Public DSTry As New DataSet
'Public DSTry As New System.Data.DataSet
Public Const Select_Command As String = "select idno,name,designation from try ORDER BY IDNO"
End Module


#Region "General Declarations"
Option Explicit On
'Option Strict On
Imports System.Data
Imports System.Data.OleDb
#End Region

Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "
'the follwing matter within brace will be automatically generated
[
Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents TxtIDno As System.Windows.Forms.TextBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents BtnNew As System.Windows.Forms.Button
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents BtnSave As System.Windows.Forms.Button
Friend WithEvents BtnRetrieve As System.Windows.Forms.Button
Friend WithEvents BtnExit As System.Windows.Forms.Button
Friend WithEvents CboRetrieve As System.Windows.Forms.ComboBox
Friend WithEvents TxtName As System.Windows.Forms.TextBox
Friend WithEvents TxtDesignation As System.Windows.Forms.TextBox
Friend WithEvents LinkLabel1 As System.Windows.Forms.LinkLabel
Friend WithEvents Label4 As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.TxtIDno = New System.Windows.Forms.TextBox
Me.Label1 = New System.Windows.Forms.Label
Me.TxtName = New System.Windows.Forms.TextBox
Me.Label2 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.TxtDesignation = New System.Windows.Forms.TextBox
Me.BtnNew = New System.Windows.Forms.Button
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.BtnExit = New System.Windows.Forms.Button
Me.BtnRetrieve = New System.Windows.Forms.Button
Me.BtnSave = New System.Windows.Forms.Button
Me.CboRetrieve = New System.Windows.Forms.ComboBox
Me.LinkLabel1 = New System.Windows.Forms.LinkLabel
Me.Label4 = New System.Windows.Forms.Label
Me.GroupBox1.SuspendLayout()
Me.SuspendLayout()
'
'TxtIDno
'
Me.TxtIDno.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.TxtIDno.Location = New System.Drawing.Point(112, 32)
Me.TxtIDno.Name = "TxtIDno"
Me.TxtIDno.Size = New System.Drawing.Size(64, 20)
Me.TxtIDno.TabIndex = 0
Me.TxtIDno.Text = ""
'
'Label1
'
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.ForeColor = System.Drawing.SystemColors.HotTrack
Me.Label1.Location = New System.Drawing.Point(56, 32)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(48, 16)
Me.Label1.TabIndex = 1
Me.Label1.Text = "ID No"
'
'TxtName
'
Me.TxtName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.TxtName.Font = New System.Drawing.Font("Times New Roman", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.TxtName.ForeColor = System.Drawing.Color.Black
Me.TxtName.Location = New System.Drawing.Point(112, 72)
Me.TxtName.Name = "TxtName"
Me.TxtName.Size = New System.Drawing.Size(144, 22)
Me.TxtName.TabIndex = 2
Me.TxtName.Text = ""
'
'Label2
'
Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.Location = New System.Drawing.Point(56, 72)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(48, 16)
Me.Label2.TabIndex = 3
Me.Label2.Text = "Name"
'
'Label3
'
Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label3.Location = New System.Drawing.Point(32, 112)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(72, 16)
Me.Label3.TabIndex = 4
Me.Label3.Text = "Designation"
'
'TxtDesignation
'
Me.TxtDesignation.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.TxtDesignation.Font = New System.Drawing.Font("Times New Roman", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.TxtDesignation.ForeColor = System.Drawing.Color.Black
Me.TxtDesignation.Location = New System.Drawing.Point(112, 112)
Me.TxtDesignation.Name = "TxtDesignation"
Me.TxtDesignation.Size = New System.Drawing.Size(144, 22)
Me.TxtDesignation.TabIndex = 5
Me.TxtDesignation.Text = ""
'
'BtnNew
'
Me.BtnNew.BackColor = System.Drawing.Color.Gainsboro
Me.BtnNew.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.BtnNew.ForeColor = System.Drawing.SystemColors.HotTrack
Me.BtnNew.Location = New System.Drawing.Point(8, 24)
Me.BtnNew.Name = "BtnNew"
Me.BtnNew.Size = New System.Drawing.Size(64, 32)
Me.BtnNew.TabIndex = 6
Me.BtnNew.Text = "New"
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.BtnExit)
Me.GroupBox1.Controls.Add(Me.BtnRetrieve)
Me.GroupBox1.Controls.Add(Me.BtnSave)
Me.GroupBox1.Controls.Add(Me.BtnNew)
Me.GroupBox1.Location = New System.Drawing.Point(8, 160)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(280, 72)
Me.GroupBox1.TabIndex = 7
Me.GroupBox1.TabStop = False
'
'BtnExit
'
Me.BtnExit.BackColor = System.Drawing.Color.Gainsboro
Me.BtnExit.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.BtnExit.Location = New System.Drawing.Point(206, 24)
Me.BtnExit.Name = "BtnExit"
Me.BtnExit.Size = New System.Drawing.Size(64, 32)
Me.BtnExit.TabIndex = 9
Me.BtnExit.Text = "Exit"
'
'BtnRetrieve
'
Me.BtnRetrieve.BackColor = System.Drawing.Color.Gainsboro
Me.BtnRetrieve.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.BtnRetrieve.Location = New System.Drawing.Point(140, 24)
Me.BtnRetrieve.Name = "BtnRetrieve"
Me.BtnRetrieve.Size = New System.Drawing.Size(64, 32)
Me.BtnRetrieve.TabIndex = 8
Me.BtnRetrieve.Text = "Retrieve"
'
'BtnSave
'
Me.BtnSave.BackColor = System.Drawing.Color.Gainsboro
Me.BtnSave.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.BtnSave.ForeColor = System.Drawing.SystemColors.HotTrack
Me.BtnSave.Location = New System.Drawing.Point(74, 24)
Me.BtnSave.Name = "BtnSave"
Me.BtnSave.Size = New System.Drawing.Size(64, 32)
Me.BtnSave.TabIndex = 7
Me.BtnSave.Text = "Save"
'
'CboRetrieve
'
Me.CboRetrieve.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.CboRetrieve.Location = New System.Drawing.Point(112, 32)
Me.CboRetrieve.Name = "CboRetrieve"
Me.CboRetrieve.Size = New System.Drawing.Size(64, 21)
Me.CboRetrieve.TabIndex = 8
'
'LinkLabel1
'
Me.LinkLabel1.FlatStyle = System.Windows.Forms.FlatStyle.Popup
Me.LinkLabel1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LinkLabel1.Location = New System.Drawing.Point(96, 240)
Me.LinkLabel1.Name = "LinkLabel1"
Me.LinkLabel1.Size = New System.Drawing.Size(112, 16)
Me.LinkLabel1.TabIndex = 9
Me.LinkLabel1.TabStop = True
Me.LinkLabel1.Text = "Data Grid View"
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(8, 232)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(280, 32)
Me.Label4.TabIndex = 10
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.SystemColors.ActiveBorder
Me.ClientSize = New System.Drawing.Size(288, 261)
Me.Controls.Add(Me.LinkLabel1)
Me.Controls.Add(Me.CboRetrieve)
Me.Controls.Add(Me.TxtIDno)
Me.Controls.Add(Me.TxtDesignation)
Me.Controls.Add(Me.TxtName)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.Label4)
Me.ForeColor = System.Drawing.SystemColors.HotTrack
Me.Name = "Form1"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScree n
Me.Text = "Form1"
Me.GroupBox1.ResumeLayout(False)
Me.ResumeLayout(False)

End Sub

]
#End Region

#Region "Load Events"
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CboRetrieve.Visible = False
CboRetrieve.Enabled = False
TxtIDno.Enabled = False
mode = True
End Sub
#End Region

#Region "Procedural Declarations"

Private Sub Count()
Dim cnSQL As OleDbConnection
Dim cmSQL As OleDbCommand
Dim drSQL As OleDbDataReader
Dim strSQL As String

Try

strSQL = "select count(*) from try"

cnSQL = New OleDbConnection(ConnectionString)
cnSQL.Open()

cmSQL = New OleDbCommand(strSQL, cnSQL)
drSQL = cmSQL.ExecuteReader()

If drSQL.Read() Then

TxtIDno.Text = drSQL.Item("idno").ToString()

End If

drSQL.Close()
cnSQL.Close()
cmSQL.Dispose()
cnSQL.Dispose()

Catch e As OleDbException
MsgBox(e.Message, MsgBoxStyle.Critical, "oledb Error")

Catch e As Exception
MsgBox(e.Message, MsgBoxStyle.Critical, "General Error")
End Try

End Sub

Private Sub clearCombo()
CboRetrieve.SelectedIndex = -1
CboRetrieve.SelectedItem = 0
CboRetrieve.SelectedValue = 0
CboRetrieve.SelectionLength = 0
End Sub
Private Sub combo()
'Dim strSql As String = "SELECT * FROM try order by idno"
Dim adap As New OleDb.OleDbDataAdapter(Select_Command, ConnectionString)
adap.Fill(DSTry, "try")
adap.Dispose()
CboRetrieve.DataSource = DSTry.Tables("try")
CboRetrieve.DisplayMember = DSTry.Tables("try").Columns(0).ColumnName
CboRetrieve.ValueMember = DSTry.Tables("try").Columns(0).ColumnName

End Sub

Private Sub Save_me()
Dim DAdapter As New OleDb.OleDbDataAdapter(Select_Command, ConnectionString)

Try
Me.BindingContext(DSTry, _
"try").EndCurrentEdit()

DAdapter.Update(DSTry, _
"try")

MessageBox.Show("Saved Successfully")

Catch eSave As System.Exception
MessageBox.Show(eSave.Message)

End Try

End Sub

'Dim strSql As String = "insert into try(name,designation) values"


Private Sub CheckEntry()
'Dim cnSQL As OleDbConnection
'Dim cmSQL As OleDbCommand
'Dim strSQL As String
'Dim verSqlRed As OleDbDataReader

'Try
'strSQL = "select * from try" & _
'" where idno = " & TxtIDno.Text & ""


'cnSQL = New OleDbConnection(ConnectionString)
'cnSQL.Open()

'cmSQL = New OleDbCommand(strSQL, cnSQL)
'verSqlRed = cmSQL.ExecuteReader
'If verSqlRed.Read = True Then
' MessageBox.Show("This ID Number Already Exists")
' TxtIDno.Text = ""
' TxtIDno.Focus()
' Exit Sub
If mode = True Then
' Dim msg As String
' Dim title As String
' Dim style As MsgBoxStyle
' Dim response As MsgBoxResult
' msg = "The Mobile Number Already Exists,Do you want to update the data?"
' style = MsgBoxStyle.DefaultButton2 Or _
' MsgBoxStyle.Critical Or MsgBoxStyle.YesNo
' title = "Confirmation of Saving data" ' Define title.
' response = MsgBox(msg, style, title)
' If response = MsgBoxResult.No Then
' Exit Sub
' Else
' Call updatedata()
' End If
'Else
Call SaveData()
'''Call Save_me()
Else
Call updatedata()
'''Call Save_me()
End If


' cnSQL.Close()
' cmSQL.Dispose()
' cnSQL.Dispose()

'Catch e As OleDbException
' MsgBox(e.Message, MsgBoxStyle.Critical, "Oledb Error")

'Catch e As Exception
' MsgBox(e.Message, MsgBoxStyle.Critical, "General Error")
'End Try
End Sub
Private Sub SaveData()
If TxtName.Text = "" Or TxtDesignation.Text = "" Then
MessageBox.Show("Fill Data into Every Field")
Exit Sub
Else

Dim msg As String
Dim title As String
Dim style As MsgBoxStyle
Dim response As MsgBoxResult
msg = "Do you want to save the data?"
style = MsgBoxStyle.DefaultButton2 Or _
MsgBoxStyle.Critical Or MsgBoxStyle.YesNo
title = "Confirmation of Saving data" ' Define title.
response = MsgBox(msg, style, title)
If response = MsgBoxResult.No Then
Exit Sub
Else
Dim cnSQL As OleDbConnection
Dim cmSQL As OleDbCommand
Dim strSQL As String
Dim intRowsAffected As Integer

Try
strSQL = "insert into try(name,designation)" & _
" values('" & _
TxtName.Text & "', '" & _
TxtDesignation.Text & "')"

cnSQL = New OleDbConnection(ConnectionString)
cnSQL.Open()

cmSQL = New OleDbCommand(strSQL, cnSQL)
cmSQL.ExecuteNonQuery()

cnSQL.Close()
cmSQL.Dispose()
cnSQL.Dispose()

MessageBox.Show("Saved Successfully")
Call clear()
Catch Exp As OleDbException
MsgBox(Exp.Message, MsgBoxStyle.Critical, "Oledb Error")

Catch Exp As Exception
MsgBox(Exp.Message, MsgBoxStyle.Critical, "General Error")
End Try
End If
End If
End Sub

Private Sub clear()
'TxtIDno.Text = ""
TxtIDno.Visible = True
TxtIDno.Enabled = False
TxtName.Text = ""
TxtDesignation.Text = ""
End Sub

Private Sub updatedata()

If TxtName.Text = "" Or TxtDesignation.Text = "" Then
MessageBox.Show("Fill Data into Every Field")
Exit Sub
Else
Dim cnSQL As OleDbConnection
Dim cmSQL As OleDbCommand
Dim strSQL As String
Dim intRowsAffected As Integer

Try
strSQL = "UPDATE try SET" & _
" Name = '" & TxtName.Text & "'" & _
" ,designation = '" & TxtDesignation.Text & "'" & _
" WHERE idno = " & CboRetrieve.Text & ""

cnSQL = New OleDbConnection(ConnectionString)
cnSQL.Open()

cmSQL = New OleDbCommand(strSQL, cnSQL)
intRowsAffected = cmSQL.ExecuteNonQuery()

If intRowsAffected <> 1 Then
MsgBox("Update Failed.", MsgBoxStyle.Critical, "Update")
End If

cnSQL.Close()
cmSQL.Dispose()
cnSQL.Dispose()

MessageBox.Show("Updated Successfully")
Catch e As OleDbException
MsgBox(e.Message, MsgBoxStyle.Critical, "Oledb Error")

Catch e As Exception
MsgBox(e.Message, MsgBoxStyle.Critical, "General Error")
End Try
End If
clear()
clearCombo()
End Sub

Private Sub PopulateForm()
Dim cnSQL As OleDbConnection
Dim cmSQL As OleDbCommand
Dim drSQL As OleDbDataReader
Dim strSQL As String

Try

strSQL = "SELECT name, " & _
"designation " & _
"FROM try " & _
"WHERE idno = " & CboRetrieve.Text & ""



cnSQL = New OleDbConnection(ConnectionString)
cnSQL.Open()

cmSQL = New OleDbCommand(strSQL, cnSQL)
drSQL = cmSQL.ExecuteReader()

If drSQL.Read() Then

TxtName.Text = drSQL.Item("NAME").ToString()
TxtDesignation.Text() = drSQL.Item("designation").ToString()

End If

drSQL.Close()
cnSQL.Close()
cmSQL.Dispose()
cnSQL.Dispose()

Catch e As OleDbException
MsgBox(e.Message, MsgBoxStyle.Critical, "oledb Error")

Catch e As Exception
MsgBox(e.Message, MsgBoxStyle.Critical, "General Error")
End Try

End Sub
#End Region

#Region "Click Events"


Private Sub BtnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSave.Click
'Call CheckEntry()
Call Save_me()
'Dim DAdapter As New OleDb.OleDbDataAdapter(Select_Command, ConnectionString)

'Try
' Me.BindingContext(DSTry, _
' "Try").EndCurrentEdit()

' DAdapter.Update(DSTry, _
' "Try")

' MessageBox.Show("Saved Successfully")

'Catch eSave As System.Exception
' MessageBox.Show(eSave.Message)

'End Try

End Sub

Private Sub BtnNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnNew.Click
mode = True
CboRetrieve.Visible = False
CboRetrieve.Enabled = False
TxtIDno.Visible = True
TxtIDno.Enabled = True
TxtIDno.Focus()
Call clear()
'Call Count()
End Sub

Private Sub BtnRetrieve_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnRetrieve.Click
mode = False
CboRetrieve.Visible = True
TxtIDno.Visible = False
CboRetrieve.Enabled = True
TxtIDno.Enabled = False
Call combo()
Call clearCombo()
End Sub

Private Sub BtnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnExit.Click
End
'Me.Hide()
End Sub
Private Sub CboRetrieve_SelectionChangeCommitted(ByVal sender As Object, ByVal e As System.EventArgs) Handles CboRetrieve.SelectionChangeCommitted
PopulateForm()
End Sub
#End Region


Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs ) Handles LinkLabel1.LinkClicked
Dim form1 As New FrmGrid
form1.Show()
Call clearCombo()
Call clear()
End Sub
End Class

bolandi48
سه شنبه 11 فروردین 1388, 10:59 صبح
من برای وی بی 2008استفاده کرد م مشکل داشت درشرایط مساوی ولی اکسس 2003بدون مشکل اجراشد

simorqh
شنبه 05 اردیبهشت 1388, 15:27 عصر
سلام بچه ها
من تو اکسس 2007 با وارد کردن جدوالهای کیوری توی فرمها مشکل دارم اگه یکی راهنمائی کننه ممنون میشم
توضیح( قبلا وقتی میخواستم تو یه فرم از کیوری استفاده کنم مثل جدول ها تو یه کمبو باکس اسم کیوری ها هم میومد اما الان فقط جدول ها میاد نمی دونم کیوری ها را چطور اضافه کنم

hamid108
چهارشنبه 09 اردیبهشت 1388, 16:23 عصر
سلام. فکر نکنم بتونی به صورت ویزارد از 2007 استفاده کنی. ولی در روش دستی به جای اینکه بنویسیmicrosoft.oldb.4.0 با ید بنویسی 12.0 . من که از همین روش استفاده می کردم و جواب می داد. امتحان کن ضرری نداره.:متفکر:

sehm67
یک شنبه 20 آذر 1390, 22:33 عصر
سلام دوستان عزیز
امکان استفاده از اکسس 2007 تو vb هست یانه ......... خواهشناً زودتر جواب بدین

جواب برای دوستانی که این پست را مشاهده می کنند.

بله بعد از نصب اکسس 2007 .

کنترل adodc رو به پروژه اضافه نمایید واز قسمت Custom گزینه Build را انتخاب و لیست مورد نظر گزینه Microsoft Office 12.0 Access Database Engine OLE DB Provider رو انتخاب نمایید و گزینه Next را انتخاب و در صفحه بعد در قسمت Data Source آدرس پایگاه داده را وارد نمایید.
از طریق کد نویسی :
در قسمت فرم لود برنامه این کد را وارد نمایید:

Adodc1.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source= " & App.Path & "\Bank.accdb ;Jet OLEDB:Database Password=;"
Adodc1.RecordSource = "SELECT * FROM Table1"
Adodc1.Refresh

راه انداز اکسس 2007 در سیستم هایی که اکسس 2007 نصب نمی باشد.

http://barnamenevis.org/showthread.php?312661-%D8%A7%D9%86%D8%AA%D8%AE%D8%A7%D8%A8-%D9%BE%D8%A7%DB%8C%DA%AF%D8%A7%D9%87-%D8%AF%D8%A7%D8%AF%D9%87-%D8%A8%D8%B1%D8%A7%DB%8C-%D8%A8%D8%B1%D9%86%D8%A7%D9%85%D9%87