D
Dennis
Hello
I have troubles when work with databases through VBA Codes in Excel 2003
Standar Edition. How or what is the way to do?
Also, the instruction chr(13) not is acceptable in VBA Codes of Excel 2000
or 2003 Standar Edition.
My example:
Dim cnn As New ADODB.Connection
Set cnn = New Connection
dbName = ("C:\Data\MYDataBase1.mdb")
With cnn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Mode = adModeWrite
.Properties("Jet OLEDBatabase Password") = "abc"
.Open dbName
End With
'Create the recordset
Dim rs As ADODB.Recordset
Set rs = New Recordset
'Determines what records to show
Dim strSQL As String
strSQL = "DROP TABLE MYTABLE;"
'Retreive the records
rs.CursorLocation = adUseClient
rs.Open strSQL, cnn
'close connection
cnn.Close
Set cnn = Nothing
Set rs = Nothing
I have troubles when work with databases through VBA Codes in Excel 2003
Standar Edition. How or what is the way to do?
Also, the instruction chr(13) not is acceptable in VBA Codes of Excel 2000
or 2003 Standar Edition.
My example:
Dim cnn As New ADODB.Connection
Set cnn = New Connection
dbName = ("C:\Data\MYDataBase1.mdb")
With cnn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Mode = adModeWrite
.Properties("Jet OLEDBatabase Password") = "abc"
.Open dbName
End With
'Create the recordset
Dim rs As ADODB.Recordset
Set rs = New Recordset
'Determines what records to show
Dim strSQL As String
strSQL = "DROP TABLE MYTABLE;"
'Retreive the records
rs.CursorLocation = adUseClient
rs.Open strSQL, cnn
'close connection
cnn.Close
Set cnn = Nothing
Set rs = Nothing