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

IFRAMES and DB Access Colision?

Status
Not open for further replies.

ahmun

IS-IT--Management
Jan 7, 2002
432
US
ok... I'm at my whit's end here... I have spent almost half the day just troubleshooting this error...

HELP?

I am setting up a form much like I do in Access; a form that contains sub forms. However, in my ASP pages, I have a main page with two IFRAMES.

Each of these IFRAMES load a "list.asp" and a "details.asp", respectively.

Both pages mentioned above access the same table in the database.. list.asp queries the database w/o any WHERE clause. Details.asp queries the database with a criteria.

But for some reason that I can't figure out, Details.asp keeps returning an error:

Code:
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

with accompanying line number where the error occurs. This line number happens to be where I open the recordset:
Code:
rsGL_ClaimDetails.open sSQL_ClaimDetails, myConnection , 3, 1

Before you ask me to paste my SQL queries... here's the weird thing: When I copy that query AND the line of code to open the recordset over to "list.asp" I have no problems. So this shows me that the query isn't wrong...

argggg... any ideas?




Earnie Eng
 
Ok... FYI all... and thanks to those who took the time to look at this thread...

for some reason, when I do a double-doublequote to put a doublequote into the SQL statement, ASP didn't like that.

I ended up re-coding the page from scratch and was able remove the error.

Here's the problem query string:
Code:
sSQL_ClaimDetails = "SELECT * FROM GL_tblGLClaims
WHERE strGLAccidentCode=""" & strGLAccidentCode & """;"

could it be that Jet SQL doesn't like doublequotes to surround strings?

Once I changed the query to read:
Code:
sSQL_ClaimDetails = "SELECT * FROM GL_tblGLClaims
WHERE strGLAccidentCode='" & strGLAccidentCode & "';"

using single quote marks instead, the error went away. (note, even though tek-tips shows the above strings as as two lines, it is all on one line in my code)


Earnie Eng
 
and... in effort to push forward with my current project, I'm not gonna do any more tests to find out if it is just a simple double/single quote that was causing me hours of grief. But if anybody has had experience on this matter of jet SQL/ADODB/Syntax I'd be curious as to why I had a problem...



Earnie Eng
 
I'm not aware of any SQL where double-quotes are used as string delimiters. Everything I've used certainly likes single quotes, anyway (with double single-quotes to indicate a literal single quote character).
 
hm... I guess there is a deviation between writing SQL statements in Access and in ASP..

I do most of my development in Access.

Earnie Eng
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top