adodb connection

S

sheepy007

Hi I'm new to all this and would really appreciate some help trying to
connect an access database to infopath.

I have got the following code but it stops on the first line everytime I try
to preview the form, any ideas?

Sub CTRL1_5_OnClick(eventObj)

Dim con As New ADODB.Connection
Dim con_string As String
Dim sql As String
Dim rs As New ADODB.Recordset
con_string = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source =
"\\Ubhnt122\U_Data.mdb"
con.Open
con_string

rst.open "select * from tblData", currentProject.connection

Any help wpuld be much appreciated

End Sub
 
S

sheepy007

it says...

"Expected end of statement
File:script.vbs
Line:34
dim con As New ADODB.Connection"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top