CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Dlookup Question

Print topic Send  topic

Author Message
Tim
Posted: 12/19/2003, 1:15 PM

HELP!!! I can't seem to get this Dlookup to pass a variable to the command. Here is what I have and the error I am getting, I am using ASP and Access Database.

Dim Equimpent
Equimpent = SpareParts_with_LocationSearch.s_EQUIP_NO.value
SpareParts_with_LocationSearch.TextBox1.Value = CStr(CCDLookUp("EQUIP_NO","[SPAREPARTS WITH LOCATION]","EQUIP_NO = " & Equimpent,DBConnection1))

Source: CCDLookUp function
Command Text: SELECT EQUIP_NO FROM [SPAREPARTS WITH LOCATION] WHERE EQUIP_NO = pm-001
Error description: No value given for one or more required parameters. (Microsoft JET Database Engine)

It is passing the variable to the Select statement but is is not finding any data, If I just put in "EQUIP_NO = 'PM-001'" it will work. How do I have to code this so it sees it right.
Edd
Posted: 12/20/2003, 5:37 PM

You forgot the single quotes around equipment , ie

SpareParts_with_LocationSearch.TextBox1.Value = CStr(CCDLookUp("EQUIP_NO","[SPAREPARTS WITH LOCATION]","EQUIP_NO = " & Equimpent,DBConnection1))

Should be

SpareParts_with_LocationSearch.TextBox1.Value = CStr(CCDLookUp("EQUIP_NO","[SPAREPARTS WITH LOCATION]","EQUIP_NO='" & Equimpent & "'",DBConnection1))

In the words of that great philosopher Homer - Doh!

Edd
Tim
Posted: 12/20/2003, 6:47 PM

DOH...

Thanks for you help.

Tim

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.