Hi
I'm inserting a row into a table. I was wondering can i just use the connection object directly, or is there some need to use recordset?
My code:
-----
Dim cnn As ADODB.Connection
Set cnn = New ADODB.Connection
With cnn
.Provider = "MSDASQL"
.ConnectionString = "DSN=Customer-database;"
.Mode = adModeShareExclusive
.Open
End With
strSQL = "INSERT INTO customer VALUES ('" & cname & "', '" & cnumber & "')"
cnn.Execute (strSQL)
cnn.Close
Set cnn = Nothing
-----
Any suggestions how to make the code better?
Thanks!