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

Take a look at sql statement

Status
Not open for further replies.

false420

Programmer
Mar 31, 2005
87
US
Ok, im new to sql. dont have much time to learn until our stuff is migrated and running. its almost done but ive ran into a small issue. ive been looking at this for 2 hours and cant figure it out. whats wrong with this:

Dim strIsApproved
strIsApproved = "SELECT * FROM InvoiceApproval WHERE Month_Date >= '" & Option_Date & "' AND Month_Date < '" & toDate & "' AND Service = " & service & " AND Cost_Center = " & Service_CC_hold & " AND Carrier = " & Service_Car_hold & " AND Account = " & Service_Acc_hold & " AND Disapproved = false"
Dim objRS_IsApproved
Set objRS_IsApproved = Server.CreateObject("ADODB.Recordset")
objRS_IsApproved.Open strIsApproved, objConnHD, adOpenKeyset


This is my error: ODBC driver does not support the requested properties

also does anyone know a good site with some sql statement examples?
 
You getting the error on this line...?

objRS_IsApproved.Open strIsApproved, objConnHD, adOpenKeyset
 
try
objRS_IsApproved.Open strIsApproved, objConnHD, 3, 3

_______
I love small animals, especially with a good brown gravy....
 
first didnt work, even with default cursor. i will try next now
 
hmmm... that didnt work either. plus i got a syntax error near the period in the open staement. this is puzzling me
 
i was thinking it was something in the sql statement itself
ive used adopenkeyset in others and it works
 
it looked fine when i first got the error but im going to double check
 
Can you Response.Write the full SQL string once you have built it and paste it here so we can check what is actually being executed.

As a start I would guess it has something to do with this line:

Code:
AND Disapproved = false

False is not a valid value in SQL Server. Either search for the literal string 'false' or, if it is a bit column then use 0 (or 1 for true).

--James
 
I'm just thinking if it was a SQL statement problem, you'd get an invalid syntax error or something? So thats why I think the problem lies elsewhere. Maybe you could try setting the cursorlocation of the connection. This sometimes solves my problems.

objConnHD.Cursorlocation = 2 'server cursor ... OR ...
objConnHD.Cursorlocation = 3 'client

*shrugs*
 
SELECT * FROM InvoiceApproval WHERE Month_Date >= '1/16/2005' AND Month_Date < '2/1/2005' AND Service = Mobile AND Cost_Center = 101.80360.40009304 AND Carrier = Cingular Wireless AND Account = 21152124-001-21 AND Disapproved = false


you may be right
 
the cursor location didnt work, it seems like it runs into the problem when opening the rs though
 
im gonna try a few things. this is the last bug i have to work out..... i believe lol
 
You are missing single quotes around all your character values:

Code:
SELECT * FROM InvoiceApproval WHERE Month_Date >= '1/16/2005' AND Month_Date < '2/1/2005' AND Service = [red]'[/red]Mobile[red]'[/red] AND Cost_Center = [red]'[/red]101.80360.40009304[red]'[/red] AND Carrier = [red]'[/red]Cingular Wireless[red]'[/red] AND Account = [red]'[/red]21152124-001-21[red]'[/red] AND Disapproved = [red]'[/red]false[red]'[/red]

--James
 
It looks like everything is being passed trhough the statement fine. this is a mystery to me
 
SELECT * FROM InvoiceApproval WHERE Month_Date >= '2/16/2005' AND Month_Date < '3/1/2005' AND Service = 'Mobile' AND Cost_Center = '101.80360.11161798' AND Carrier = 'Bluegrass Cellular' AND Account = '0-01 0217323 0' AND Disapproved = 'false'


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

ODBC driver does not support the requested properties.

/a_invoices.asp, line 433

hmmmm....... ive checked my connections and everything. i cant see whats wrong
 
would anyone need anymore info about the issue? id be glad to produce anything.... im stuck like chuck
 
you connecting to SQL or access?, and could you post the connection string (obviously starring out passwords?)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top