How can I connect my msacces database and use SQL query command like "Select Field FROM Table Where Field1 = foo AND Field2 = foo2" in Visual basic 6 and display the query result to a textbox.
forjustincase 0 Newbie Poster
Recommended Answers
Jump to PostTry something similar to -
Dim cnCheck As ADODB.Connection Set cnCheck = New ADODB.Connection Dim rsCheck As ADODB.Recordset Set rsCheck = New ADODB.Recordset cnCheck.CursorLocation = adUseClient cnCheck.Open "provider = microsoft.jet.oledb.4.0;persist security info=false;data source = " & App.Path & "\MyDatabaseName.mdb" rsCheck.Open "SELECT Field1, Field2 FROM TableNameHere WHERE Field1='foo' …
Jump to Post"SELECT Field1, Field2 FROM TableNameHere WHERE Field1='" & Text1.Text & "' AND Field2='" & Text2.Text & "'", cnCheck, adOpenDynamic, adLockPessimistic
All 6 Replies
BitBlt 452 Practically a Master Poster Featured Poster
AndreRet 526 Senior Poster
forjustincase 0 Newbie Poster
AndreRet 526 Senior Poster
forjustincase 0 Newbie Poster
AndreRet 526 Senior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.