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.
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.