Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Time Error 91! What am I missing?
What am I doing wrong? I get a run time error 91 when I get to
" .CommandText = SqlSet". please help. Private Sub UpdateAccess1_Click() Dim DBFullName As String Dim Cnct As String Dim cnn As ADODB.Connection Dim cmdCommand As ADODB.Command Dim SqlSet DBFullName = ThisWorkbook.Path & "\NewAccountDatabase.mdb" Set cnn = New ADODB.Connection Cnct = "Provider=Microsoft.Jet.OLEDB.4.0;" Cnct = Cnct & "Data Source=" & DBFullName & ";" cnn.Open ConnectionString:=Cnct SqlSet = " INSERT INTO AccountMaster ([Account Number], [Account Name], [Clone Manager])" SqlSet = SqlSet & " VALUES ( " & Range("Number3").Value & " , " & Range("Name3").Value & ")" & " , " & Range("Manager3").Value & ");" With cmdCommand .CommandText = SqlSet .CommandType = adCmdText .Execute End With cnn.Close Set cmdCommand = Nothing Set cnn = Nothing End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Inserting missing date/time | Excel Worksheet Functions | |||
Missing X error bar options | Excel Discussion (Misc queries) | |||
XP VBA Compile error...Missing files | Excel Programming | |||
On Error? Creates 1 missing worksheet then never detects any other missing worksheets | Excel Programming | |||
Missing Word 10 Object Error References | Excel Programming |