you can use ADODB or ADODC to connect your database.
that is what am doing when i make connections.
you must first add MIcrosoft OLE data objects 2.8 (something like that) in your reference.
to add ADODC object, in your components you must check Microsoft active data objects. the adodc object will then be available in your toolbar.
then configure your adodc, you can use UDL, DSN (ODBC), or connection string.
bout adodb, you actually do codes for connections
[CODE=vb]'sample:
dim con as ADODB.Connectio n
dim rs as ADODB.Recordset
'then to make the connection
con.open "Provider = Microsoft.Jet.O LEDB.4.0; data source = (place here the path of your database)"
' with rs, this is where you write ur SQL
' sample
rs.open "SELECT * FROM TABLE_NAME", con, 3, 3[/CODE]
this is basically what i do with my connections...
hope this could help you...
just search the net about ADODC and ADODB...
enjoy programming!
Last edited by Killer42; Jun 23 '07, 01:37 AM.
Reason: Added [CODE=vb] tag
hlo vinci
what should i done to delete, update, save, edit
the files in connecting ms acces to visual basic.
can you give me a sample program?
mr. Joco Costanilla
Please use ADOX. Here is a sample program. first reference to msadox.dll at sytem file and use the following code.
[CODE=vb]Sub AddTable(tablen ame As String)
Dim tbl As New Table
Dim cat As New ADOX.Catalog
Dim idxNew As New ADOX.Index
tbl.Columns.App end "QN", adInteger
tbl.Columns.App end "ChapCode", adInteger
tbl.Columns.App end "Question", adLongVarWChar
tbl.Columns.App end "OptionA", adLongVarWChar
tbl.Columns.App end "OptionB", adLongVarWChar
tbl.Columns.App end "OptionC", adLongVarWChar
tbl.Columns.App end "OptionD", adLongVarWChar
tbl.Columns.App end "CorrectAnswer" , adInteger
cat.Tables.Appe nd tbl
End Sub[/CODE]
Last edited by Killer42; Jun 23 '07, 01:38 AM.
Reason: Added [CODE=vb] tag
I was wandering if anyone could help me out im trying to connect my visual basic project to access databse table, where it has to check if the username and password exit can some one please help me out.
I was wandering if anyone could help me out im trying to connect my visual basic project to access databse table, where it has to check if the username and password exit can some one please help me out.
Comment