[Microsoft][ODBC Microsoft Access 97 Driver] Too few parameters. Expected 1.
Microsoft article Q216425 says that the only way this error message can be generated is if you are trying to access a field that doesn't exist. I've checked and rechecked my code, and I can't seem to find an instance of this. I suspect a problem with the SQL - here is a sample of the code that I think is causing the problem.
ElseIf Session("EditMode"
= "New" Then
sSQL = "insert into Location (LocationCode, Region, Branch, Building, StreetAddress, "
sSQL = sSQL & "City, State, Zip, Phone, Fax) values ("
sSQL = sSQL & "'" & sLocationCode & "' "
sSQL = sSQL & ",'" & sRegion & "' "
sSQL = sSQL & ",'" & sBranch & "' "
sSQL = sSQL & ",'" & sBuilding & "' "
sSQL = sSQL & ",'" & sStreetAddress & "' "
sSQL = sSQL & ",'" & sCity & "' "
sSQL = sSQL & ",'" & sState & "' "
sSQL = sSQL & "," & Session("Zip"
sSQL = sSQL & ",'" & sPhone & "' "
sSQL = sSQL & ",'" & sFax & "')"
cmd.CommandText = sSQL
cmd.CommandType = adCmdText
cmd.Execute
I've checked out info the command object in my books, and I've seen one other post on tek-tips about it, but I still can't seem to figure where there's an error.
Can anyone else suggest? How much more water would there be in the ocean if it weren't for sponges?
Microsoft article Q216425 says that the only way this error message can be generated is if you are trying to access a field that doesn't exist. I've checked and rechecked my code, and I can't seem to find an instance of this. I suspect a problem with the SQL - here is a sample of the code that I think is causing the problem.
ElseIf Session("EditMode"
sSQL = "insert into Location (LocationCode, Region, Branch, Building, StreetAddress, "
sSQL = sSQL & "City, State, Zip, Phone, Fax) values ("
sSQL = sSQL & "'" & sLocationCode & "' "
sSQL = sSQL & ",'" & sRegion & "' "
sSQL = sSQL & ",'" & sBranch & "' "
sSQL = sSQL & ",'" & sBuilding & "' "
sSQL = sSQL & ",'" & sStreetAddress & "' "
sSQL = sSQL & ",'" & sCity & "' "
sSQL = sSQL & ",'" & sState & "' "
sSQL = sSQL & "," & Session("Zip"
sSQL = sSQL & ",'" & sPhone & "' "
sSQL = sSQL & ",'" & sFax & "')"
cmd.CommandText = sSQL
cmd.CommandType = adCmdText
cmd.Execute
I've checked out info the command object in my books, and I've seen one other post on tek-tips about it, but I still can't seem to figure where there's an error.
Can anyone else suggest? How much more water would there be in the ocean if it weren't for sponges?