INSERT.. query

L

Laura

If you are using ADO:

Dim gCn As ADODB.Connection
Dim strSQL As String
Dim sConnString As String
Dim sDataSource As String

sDataSource = DATABASE PATH

sConnString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & sDataSource & ";" & _
"Jet OLEDB:Database Password=IF THERE IS A
PASSW;"

Set gCn = New ADODB.Connection
gCn.Open sConnString

strSQL = "INSERT INTO table1 (Field1, Field2) "
strSQL = strSQL & VALUES (Value1, Value2)"

gCn.Execute strSQL
 

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