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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax of query string using ASP

Status
Not open for further replies.

PleaseGiveHelp

Programmer
Oct 29, 2002
131
0
0
US
I am doing something wrong with my query string because I continuously get a message similar to:

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

[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ','.

/User_Info/processChanges.asp, line 15

When I hit the submit button. This is the code:

strSQL = "execute test_script" & user_id & ", '" & password & "', '" & user_id_1 & "', '" & user_id_2 & "', " & deleted & " "

set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.Open strSQL,db,0,1

What is wrong with the comma (in the error)? I can't see the problem. Please help.
 
one or more of the variables is probably empty.

Try some basic initial debugging. write out strSQL to the browser. the problem will more than likely become obvious

Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Though now in order to pass the variables, I think I have the syntax incorrect. It keeps asking for an object. This is what I have:

<form name="SubmitMe" method="post" action="../../User_Info/processChanges.asp?user_id= <% =user %>&amp;password= <% =txtpassword.text %>&amp;user_id_1= <% =txtuser_id_1.text %>&amp;user_id_2= <% =txtuser_id_2.text %>&amp;deleted= <% =txtdeleted %>&amp;page= <% =page %>" target="frame2">
<div align="center"><input type="submit" name="SubmitActual" value="Submit"></div></form>

I assume it refers to the text.text portions. What is the object? Help!
 
If I have multiple forms on a page, do I need to somehow refer to which form I am using to yield the value of what is in the text box?
 
Ok, the error with your QueryString your building is that your escaping into ASP code to write out the values. ASP doesn't have any objects named txtpassword, txtuser_id_1, etc
I rthink what you were trying to do is write the values from the form on that same page into the querystring, which means you need to do one of two things:
a) Use a form and just set the method="GET" and put a submit button in there instead of a link (or set the onCLick for the link="frmname.submit();" and get rid of the href address)

or

b) Write a javascript function that will get the form values then build the URL and set the window location to that URL



The direct reason for object error is because your trying to access variables that don't exist (although this isbeing ignored, so I assume Option Explicit isn't listed at the head of your code) and then you use dot notation to try to get a value from those unknown variables (in this case .text). Since those variables are nopt objects, the code is giving you an error that basically says "I'm not sure what you wanted, but you just tried to treat that variable like an object and it ain't one...err, so i was expecting an object, it ain't an object, here hasve an 'Object Expected' error"

Hope some of that helped,
-T


[sub]01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111[/sub]
Help, the rampaging, spear-waving, rabid network gnomes are after me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top