Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-time Error 3061 too few parameters 1

Status
Not open for further replies.

Ricjd

Programmer
Sep 12, 2002
104
GB
hey.

im my code which is as follows...

Code:
Dim mySQL As String
Dim Rst As Recordset
Dim db As Database
Set db = CurrentDb()

mySQL = "SELECT * FROM passwords WHERE passwords.ID = " & ID & ";"
Set Rst = db.OpenRecordset(mySQL)

i get this error

Run-time Error 3061
Too Few Parameters

!!!!

when i tyoe doa.recordset or doa.database it says user defined type not defined. yet i can use dim rst as recordset fine. i have the Microsoft DOA 3.6 Object Libary thing sellected. is there anything else i need selected in the refrences bit. as far as i can see the sql stament is correct.

also it doesn't like rst.edit

is there anythign you can think of? i think i need more refrences things but i don't know which ones.

p.s im using access 2002 and access 2000 file format
 
Hi

You have an error in your SQL statement.

Since it is a very simple statement, I would suggest:

Is passwords.ID a string?

if yes you need:

mySQL = "SELECT * FROM passwords WHERE passwords.ID = '" & ID & "';"

If not, have you misspelled something in the string?
Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
no passwords is a table inside the database and ID is a feild insaide the table.

i thought i was mayby a speeling error so i'vo copied and pasted everything.

rick
 
How about trying DAO.recordset and DAO.database. Not sure if this was a typo in your message....

Kind regards
Borg
 
Hi

no passwords is a table inside the database and ID is a feild insaide the table.

I know that, the question is, is Id defined as a string of a number? Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
its defined as a string eg TP for the tools page

and yeah i've tried dao
 
soz forgot to finish my msg.

and i got it all wrong anyways.

i've just tried dao and the edit thing now comes up but i still egt the same error.

but the id field is defined string
 
TRy the following :

mySQL = "SELECT * FROM passwords WHERE ID = '" & ID & "';"

hth
Borg
 
Or even better :

mySQL = "SELECT * FROM passwords WHERE ID = " & "'" & ID & "'"

kind regards
Borg
 
oh i see. gah im so dumb. i totaly missed that.

rick
 
Hi

Yes, hate to say it but I gave that answer several posts back Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top