Stockton.S
Nov 17th, 2000, 03:30 AM
Here is the problem:
I am trying to execute the action query UPDATE but I get an error "Too few parameters, expected '1' "
Here is the code:
Dim qdfAppend As QueryDef
Dim AppendDb As Database
Dim AppendRs As Recordset
Dim AppendCon As String
Dim strSQLAppend As String
AppendCon = "ODBC;DRIVER={SQL Server};UID=;PWD=;DATABASE=MAV-DB;SERVER=Exch_Serv"
Set AppendDb = DAO.OpenDatabase("", 0, 0, AppendCon)
Set qdfAppend = AppendDb.CreateQueryDef("", strSQLAppend)
strSQLAppend = "UPDATE " & DataTable & " SET " & Exist & " = " & Chr(39) & "1" & Chr(39) & " WHERE " & PartNo_Field & " = " & PartNumber
' qdfAppend.SQL = strSQLAppend
AppendDb.Execute strSQLAppend
This line is where it errors
Thanks for your help
Simon
I am trying to execute the action query UPDATE but I get an error "Too few parameters, expected '1' "
Here is the code:
Dim qdfAppend As QueryDef
Dim AppendDb As Database
Dim AppendRs As Recordset
Dim AppendCon As String
Dim strSQLAppend As String
AppendCon = "ODBC;DRIVER={SQL Server};UID=;PWD=;DATABASE=MAV-DB;SERVER=Exch_Serv"
Set AppendDb = DAO.OpenDatabase("", 0, 0, AppendCon)
Set qdfAppend = AppendDb.CreateQueryDef("", strSQLAppend)
strSQLAppend = "UPDATE " & DataTable & " SET " & Exist & " = " & Chr(39) & "1" & Chr(39) & " WHERE " & PartNo_Field & " = " & PartNumber
' qdfAppend.SQL = strSQLAppend
AppendDb.Execute strSQLAppend
This line is where it errors
Thanks for your help
Simon