Query Code Problem

  • Thread starter Todd Huttenstine
  • Start date

T

Todd Huttenstine

I am using SQL code I thought. Can you guys help me with the following
code? I am having a problem with the following line:

objConn.Execute szSQL, , adCmdText Or adExecuteNoRecords




Dim objConn As ADODB.Connection
Dim szConnect As String
Dim szSQL As String
' Create the connection string.
szConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Employee Database.mdb;" & _
"Extended Properties=Excel 8.0;"
' Create the SQL statement.
' szSQL = "INSERT INTO Employee Database " & "VALUES(ID, Employee Name,
Employe ID, Password);"
szSQL = "INSERT INTO Employee Database VALUES ('Hetland', 'Camilla',
'Hagabakka 24', 'Sandnes')"
' Create and open the Connection object.
Set objConn = New ADODB.Connection
objConn.Open szConnect
' Execute the insert statement.
objConn.Execute szSQL, , adCmdText Or adExecuteNoRecords
' Close and destroy the Connection object.
objConn.Close
Set objConn = Nothing

' You 'll need to modify the connection string Data Source to point to
your
'Excel file and modify the SQL statement to fit your data.
 
Ad

Advertisements

J

Jacek Segit

Witaj Todd,
W Twoim li¶cie datowanym 3 maja 2004 (04:20:03) mo¿na przeczytaæ:

TH> I am using SQL code I thought. Can you guys help me with the following
TH> code? I am having a problem with the following line:

TH> objConn.Execute szSQL, , adCmdText Or adExecuteNoRecords

Lol (if I correctly understood)

objConn.Execute szSQL, , adCmdText

it should work

Regards
Jacek Segit
 

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