Sorry to bother everyone tonight but I\'m just not seeing what I\'m doing \r\nwrong with this code. It\'s the \'cn.Execute\'s insert line. I\'ve went so far \r\nas removing my var\'s and hard coding the line with data but I\'m still not \r\nseeing what I\'m doing wrong. \r\n \r\nCan anyone help? \r\n \r\n \r\n
\r\n
Code:
\r\n
Sub DB_Creation()\r\n\r\nDim cn As ADODB.Connection\r\n \r\n Set cn = New ADODB.Connection\r\n dbfilename$ = frmMain.Combo1.Text & ".mdb"\r\n \r\n If Dir$(App.Path & "\\" & dbfilename$) = "" Then Call CreateDataBase\r\n If Dir$(App.Path & "\\" & dbfilename$) = dbfilename$ Then\r\n cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\\" & dbfilename$\r\n cn.Execute "INSERT INTO AA3(Module, Game) VALUES(\'test1\', \'test2\')"\r\n cn.Close\r\n End If\r\n\r\nEnd Sub
Sorry to bother everyone tonight but I'm just not seeing what I'm doing
wrong with this code. It's the 'cn.Execute's insert line. I've went so far
as removing my var's and hard coding the line with data but I'm still not
seeing what I'm doing wrong.
Can anyone help?
Code:
Sub DB_Creation()
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
dbfilename$ = frmMain.Combo1.Text & ".mdb"
If Dir$(App.Path & "\" & dbfilename$) = "" Then Call CreateDataBase
If Dir$(App.Path & "\" & dbfilename$) = dbfilename$ Then
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\" & dbfilename$
cn.Execute "INSERT INTO AA3(Module, Game) VALUES('test1', 'test2')"
cn.Close
End If
End Sub
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET. subscribe