Question

Locked

connectivity of VB6 and MS Access

By anoopitl ·
i want to connect vb6 form to a ms access databse based on a query. how can i do so

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Solution

by 3xp3rt In reply to connectivity of VB6 and M ...

In your VB6 project open DataEnvironment (add DataEnvironment from Project menu Add Data Environment) In this window you can see the Connection (usually Connection1) Right Click on Connection, and click on Properties. From Properties windows select Connection, select Build Connection string and the connection is done.

Collapse -

Global connectionstring Solution

by royeschner In reply to Solution

'declare in Module - sub Main()
Public gstrConnectionString As String

gstrConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\MyDB.mdb";Persist Security Info=False"
''''''''''''''''''''''''''''''''''''''''
'assign global connection string to the connection
Set cn = New ADODB.Connection
cn.ConnectionString = gstrConnectionString
cn.Open

'recordset processing
Dim alphaRS As ADODB.Recordset
Dim strQuery As String

Set alphaRS = New ADODB.Recordset

strQuery = "Select * From TableName WHERE Enabled=True"

alphaRS.Open strQuery, cn, adOpenKeyset, adLockOptimistic

Collapse -

An example of just about everything on this site

by Tony Hopkinson In reply to connectivity of VB6 and M ...

http://www.blueclaw-db.com/ms_access_examples/

Look for the ADO stuff on the left hand side, half way down.

Back to Web Development Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums