Hello, im not sure if you have already done it but heres another way to connect vb to access, i use this all the time because its the best way i feel to do such a thing. firtsly make a modual and put this in
''''''''''''''''''''CODE''''''''''''''''''''''''
Public DBConnection As ADODB.Connection
Public TheRecord As ADODB.Recordset
Public userName As String
Public ODBCDSN As String
Public Function OpenDataBase()
On Error Resume Next
'The database with the name snooker inside odbc is opened
'No username or password provided
'If you had set a password and username within odbc
'for this database you must enter then here
ODBCDSN = "snooker"
userName = ""
UserPassword = ""
Set DBConnection = New ADODB.Connection
DBConnection.Open ODBCDSN, userName, UserPassword
If Err Then
MsgBox "The database could not be loaded program will now end", vbOKOnly, "Error During Loading"
End
End If
End Function
'''''''''''''''''''''''END CODE''''''''''''''''''''
all you have to do is go to control panel, and look for ODBC data source, add add the database if you are using win xp then go to control panel, performance and maintanence and then admin tools and ODBC. in the adbc form click add, select access and next and then add your database.
you can use sql statements to add, search, delete, update and all other suff using this, but you can also do this with the other way that was suggested.
in your code all you have to do is call the above function which will connect to the database, then all you have to do is write you sql commands
eg:
Dim sql
sql = "select * from membership where memberid = '" & TheID & "'"
Set TheRecord = DBConnection.Execute(sql)
any more help let us know