?
Solved

ASP using VB Script and SQL Server 6.5

Posted on 1999-11-22
2
Medium Priority
?
489 Views
Last Modified: 2012-08-13
Hi Experts

I wrote a sql in my asp page

querystring = "select subr_acct_id, subr_acct_nm from subr_acct where substr(subr_acct_nm,1,1)= substr(Upper(search),1,1)"
adors.Open querystring,"dsn=vneti;database=subscription;uid=vnetix;pwd=vnetix"

when I execute it is not able to recognise substr funtion. It returns an error saying

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]'substr' is not a recognized built-in function name.

Can you help me out.
Thx
-Vneti
0
Comment
Question by:vneti
2 Comments
 

Author Comment

by:vneti
ID: 2226519
while downloading SQL Server 6.5 I had received an error saying
"ODBC COULD NOT BE INSTALLED, COULD NOT LOAD ODBCCP32.DLL, THE ODBC INSTALLER. PLEASE INSTALL IT FROM CD"
I am not able to find this DLL. Does this any way effect the error which I am getting.
0
 
LVL 32

Accepted Solution

by:
jhance earned 280 total points
ID: 2226605
No, the problem with your substr is that it is inside the quotes of the querystring and the function (which needs to be executed by the ASP interpreter) is getting passed as part of the SQL and is not recognized by the SQL server.  Try it like this (or similar if I make a typo):

querystring = "select subr_acct_id, subr_acct_nm from subr_acct where " & substr(subr_acct_nm,1,1) & "=" & substr(Upper(search),1,1)

This way you build the querystring up from a collection of static strings in "" and the results returned from the substr functions.


0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New style of hardware planning for Microsoft Exchange server.
If you're a modern-day technology professional, you may be wondering if certifications are really necessary. They are. Here's why.
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …
Suggested Courses

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question