Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select issue
Message
De
24/02/2003 17:22:55
Fabian Belo
Independent Developer
Argentine
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
SQL Select issue
Divers
Thread ID:
00757278
Message ID:
00757278
Vues:
52
Nadya:
objRS.Open strSQL, objConnection, adOpenForwardOnly, adLockReadOnly, adCmdTableDirect
<PRE>

Change above line to

<PRE>
objRS.Open strSQL, objConnection, adOpenForwardOnly, adLockReadOnly, adCmdText
HTH

Suggestion: IMHO, lock syntax here isn't necessary, SQL manages locks on it's own fine.


This is the code, I'm trying to use for displaying data with navigation:

set objRS = server.CreateObject("ADODB.Recordset")
objRS.PageSize = 6
objRS.CacheSize = 300
objRS.CursorLocation = adUseClient

dim SearchString
searchstring = ""
strSQL = ""
icount = ""

'take all the form details and store them in the variables
'searchstring = Request.querystring("txtsearch")

strSQL = "select CredID, CreditCat, ccode, town, Address from " & _
"CreditInfo where town in ('MLFD','COLC','OLYM') order by CreditCat, Address"


'strSQL = "SELECT * FROM table WHERE fieldname='" & searchstring & "'"

objRS.Open strSQL, objConnection, adOpenForwardOnly, adLockReadOnly, adCmdTableDirect

It gives me Microsoft OLE DB Provider for ODBC Drivers (0x80040E37)
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'select'.
/nadyatest/DataWithNavigation.asp, line 38

However, this code works fine:

strSQL = "select CredID, CreditCat, ccode, town, Address from CreditInfo where town in ('MLFD','COLC','OLYM') order by CreditCat, Address"
set oRS = DBObj.Execute(SQL)
Could somebody please explain my error?

Thanks in advance.
"Since I've read that alcohol is bad... I quit reading."
Me


http://www.fabianbelo.com.ar
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform