navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

SQL troubles

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> SQL troubles
Page: [1]
 
pd_it_guy

 

Posts: 193
Joined: 3/4/2008
Status: offline

 
SQL troubles - 8/25/2008 19:14:21   
The following is a search expression where the number of characters people choose to put in FI_leader matches the same part of the begining of contact name.

thus:

<%
FI_leader=Request.Form("FI_leader")
sr_stl=len(FI_leader)

fp_sQry="SELECT * from Name_fi WHERE '::FI_leader::' =mid(contact_name,1,sr_stl) AND (status='OK')"


The variable part works, as does the query, when I put a real number in. Substituting the variable into my mid is NOT working. The straight variable name sr_stl as shown gets missing expression error, ::sr_stl:: doesnt error but retuns nothing, '::sr_stl::' gets a type mismatch error. Been at this too long today, can anyone help.


pd_it_guy

 

Posts: 193
Joined: 3/4/2008
Status: offline

 
RE: SQL troubles - 8/25/2008 19:21:42   
Sorry all for my panic- the one thing I didnt think to try,

FI_leader=Request.Form("FI_leader")
sr_stl=len(FI_leader)

fp_sQry="SELECT * from Name_fi WHERE '::FI_leader::' =mid(contact_name,1," & sr_stl & ") AND (status='OK')"

Works perfectly. I guess this is one time you can put double quotes within the SQL's double quotes???

(in reply to pd_it_guy)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: SQL troubles - 8/25/2008 19:39:37   
The double quote tells the SQL you are about to enter a variable. Then the second double quote tells the SQL to "resume" the SQL string. You will find this won't be the first time you will have to do as you did above.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to pd_it_guy)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> SQL troubles
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts