connection access2000 vb6
-
hi all i am new to vb. by seeing all type of connection i am confused. can any one guide me which is the best way to connect access2000 database as back end to vb as front end and how to do that with regards Man created god Not God created man
-
hi all i am new to vb. by seeing all type of connection i am confused. can any one guide me which is the best way to connect access2000 database as back end to vb as front end and how to do that with regards Man created god Not God created man
Kinda tricky question - ADO is a BIG topic... You can start with something like the code below (quick'n dirty) - remember to make a reference to some version of "Microsoft ActiveX Data Objects Library" or other in your project. Dim DBConn As ADODB.Connection Dim RS As ADODB.Recordset Dim ConnectionString As String Dim Query As String ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\myDatabase.mdb" Query = "Select * from myTable" Set DBConn = New ADODB.Connection DBConn.Open ConnectionString Set RS = DBConn.Execute(Query) Do Until (RS.EOF) MsgBox(RS.Fields(0)) RS.MoveNext Loop RS.Close Set RS = Nothing DBConn.Close Set DBConn = Nothing I would recomend that you download "Microsoft Data Access Components (MDAC) 2.6 SDK from" Microsoft. It's quite informative and containes a lot of examples for Visual Basic... (http://www.microsoft.com/downloads/details.aspx?FamilyID=cf5bf48d-9bbb-4ca2-9b03-4ee000db37ff&DisplayLang=en)