SQL Query HELP 
Author Message
 SQL Query HELP

I get this error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 4.

/NESAbuse/abuseform.asp, line 115

and line 115 reads as:

     objRSList.Open "UPDATE Abusers SET [Name]='"&uName&"',[IP
address]='"&uIP&"',[Login]='"&uLogin&"',[1st Scan]='"&uScan(0)&"',[1st
Offense]='"&uOffens(0)&"',[1st Email]='"&uDOE(0)&"',[Complied
Y/N]='"&Comply&"',[1st disco]='"&uDisco(0)&"',[1st
Recon]='"&uRecon(0)&"',[2nd Scan]='"&uScan(1)&"',[2nd
Offense]='"&uOffens(1)&"',[2nd Email]='"&uDOE(1)&"',[2nd
disco]='"&uDisco(1)&"',[2nd Recon]='"&uRecon(1)&"',[3rd
Scan]='"&uScan(2)&"',[3rd Offense]='"&uOffens(2)&"',[3rd
Email]='"&uDOE(2)&"',[Final disco]='"&uDisco(2)&"' WHERE [ID] = "& uID,
objDataConn, 1, 3

am i mistaken or do you see four params too?

TIA for your help

Geoff.



Tue, 18 Feb 2003 21:27:28 GMT  
 SQL Query HELP

This is certainly more code, but it helps me when I have a whole bunch of
values to run through a query:

dim strSQL     'As String
dim cm             'As ADODB.Command
strSQL = "UPDATE Abusers SET [Name]= (?) ,[IP address]= (?)," & _
    "[Login]=(?), [1st Scan]=(?), [1st Offense]= (?) ,[1st Email]=(?)," & _
    "[CompliedY/N]= (?),[1st disco]=(?),[1st Recon]=(?), " & _
    "[2nd Scan]=(?),[2nd Offense]=(?),[2nd Email]=(?), " & _
    "[2nd disco]=(?),[2nd Recon]=(?),[3rd Scan]=(?)," & _
    "[3rd Offense]=(?),[3rd Email]=(?),[Final disco]=(?) WHERE [ID] = (?)"
set cm = CreateObject("ADODB.Command")
with cm
    set .ActiveConnection = objDataConn
    .CommandText = strSQL
    .CommandType = adCmdText
    .parameters.append

    .parameters.append

    .parameters.append

    .parameters.append

    .parameters.append

    .parameters.append

    .parameters.append

    .parameters.append

    .parameters.append

    .parameters.append

    .parameters.append

    .parameters.append

    .parameters.append

    .parameters.append

    .parameters.append

    .parameters.append

    .parameters.append

    .parameters.append

    .parameters.append

end with
set objRSList = CreateObject("ADODB.Recordset")
With objRSList
    .CursorLocation = aduseClient
    .Open cm, , adOpenStatic, adLockBatchOptimistic
End With

The other thing you may want to check is that you have the column names
correct in the SQL statement and that the provider is not confusing a
misspelled column name with a missing parameter.

Kirk Allen Evans


Quote:
> Not sure what you're dsoing with the Where clause. Are you trying to set
> [ID] to uID with 3 other params appended with commas or did you leave out
> some AND clauses.

> WHERE [ID] = '"& uID &"' AND DataConn = '"&objDataConn&"' AND ...

> Check what you are trying to filter out and make sure you need 4
paramaters.
> If you do, add some AND clauses.

> Matthew Robinson



> > I get this error:

> > Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

> > [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected
4.

> > /NESAbuse/abuseform.asp, line 115

> > and line 115 reads as:

> >      objRSList.Open "UPDATE Abusers SET [Name]='"&uName&"',[IP
> > address]='"&uIP&"',[Login]='"&uLogin&"',[1st Scan]='"&uScan(0)&"',[1st
> > Offense]='"&uOffens(0)&"',[1st Email]='"&uDOE(0)&"',[Complied
> > Y/N]='"&Comply&"',[1st disco]='"&uDisco(0)&"',[1st
> > Recon]='"&uRecon(0)&"',[2nd Scan]='"&uScan(1)&"',[2nd
> > Offense]='"&uOffens(1)&"',[2nd Email]='"&uDOE(1)&"',[2nd
> > disco]='"&uDisco(1)&"',[2nd Recon]='"&uRecon(1)&"',[3rd
> > Scan]='"&uScan(2)&"',[3rd Offense]='"&uOffens(2)&"',[3rd
> > Email]='"&uDOE(2)&"',[Final disco]='"&uDisco(2)&"' WHERE [ID] = "& uID,
> > objDataConn, 1, 3

> > am i mistaken or do you see four params too?

> > TIA for your help

> > Geoff.



Sun, 02 Mar 2003 03:00:00 GMT  
 SQL Query HELP

Not sure what you're dsoing with the Where clause. Are you trying to set
[ID] to uID with 3 other params appended with commas or did you leave out
some AND clauses.

WHERE [ID] = '"& uID &"' AND DataConn = '"&objDataConn&"' AND ...

Check what you are trying to filter out and make sure you need 4 paramaters.
If you do, add some AND clauses.

Matthew Robinson


Quote:
> I get this error:

> Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

> [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 4.

> /NESAbuse/abuseform.asp, line 115

> and line 115 reads as:

>      objRSList.Open "UPDATE Abusers SET [Name]='"&uName&"',[IP
> address]='"&uIP&"',[Login]='"&uLogin&"',[1st Scan]='"&uScan(0)&"',[1st
> Offense]='"&uOffens(0)&"',[1st Email]='"&uDOE(0)&"',[Complied
> Y/N]='"&Comply&"',[1st disco]='"&uDisco(0)&"',[1st
> Recon]='"&uRecon(0)&"',[2nd Scan]='"&uScan(1)&"',[2nd
> Offense]='"&uOffens(1)&"',[2nd Email]='"&uDOE(1)&"',[2nd
> disco]='"&uDisco(1)&"',[2nd Recon]='"&uRecon(1)&"',[3rd
> Scan]='"&uScan(2)&"',[3rd Offense]='"&uOffens(2)&"',[3rd
> Email]='"&uDOE(2)&"',[Final disco]='"&uDisco(2)&"' WHERE [ID] = "& uID,
> objDataConn, 1, 3

> am i mistaken or do you see four params too?

> TIA for your help

> Geoff.



Sun, 02 Mar 2003 23:08:36 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. NULL Values in SQL Queries - HELP HELP

2. SQL Query Help

3. SQL query help

4. sql query help

5. What is wrong with this sql query - help!

6. SQl Query - Help

7. SQL Query help

8. NULL Values in SQL Queries - HELP!

9. SQL query help

10. SQL Query help needed

11. Complex SQL Query...HELP!

12. Data Control w/ SQL Query help

 

 
Powered by phpBB® Forum Software