Ask a Question related to ASP Database, Design and Development.
-
Toytown #1
SQL "Where" Problem in ASP
Hi
I just noticed this on my site the other day and its driving my crazy trying
to fix it. The ASP pages connect to a ACCESS database and attempt to get
records using sample code like the one below. Since January this has
worked without any issues (and continues to work on my test server) however
it no longer works on the live server, the only updates i have done are the
windows ones and these are the only changes that have been made to the
server.
This code works on test but not on the live server (both are using win 2000
server)
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("spirit.mdb")
Set rsDatabase = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM Characters WHERE Server = 'test'"
rsDatabase.Open strSQL, adoCon
If i change the code to the following then the code works correctly but i
need the WHERE statement to select the correct records.
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("spirit.mdb")
Set rsDatabase = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM Characters"
rsDatabase.Open strSQL, adoCon
The error message i get back using the first example is, which off course
dosent help at all
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Unknown
/testdb.asp, line 7
I have tried the following on the live server.
1. Reinstall MDAC 2.8
2. Reinstall Service Pack 4
3. Remove/Reinstall IIS
4. Reinstall Jet Service Pack 8
none of these fix it, can anybody give me any clues as to where to look? I
cant reinstall the OS!
Toytown Guest
-
Proj cannot run on LCDS 2.6 ES due to "Unable to resolveresource bundle "datamanagement" for locale "en_US"
hi, all, We have developped an application on Flex Build 3 (run successfully), but failed when we try to deploy it on Tomcat with LCDS 2.5 ES... -
Drag and drop problem with "dragEnabled" and"allowMultipleSelection"
Update 2, if it can help someone: Finally I don't manage the drag and drop by myself using DragManager.doDrag(...). Why? Because doing so if the... -
CFINPUT type="radio" w/ "value" requires "label"
On a Flash form, when you specify type='radio' and value='whatever', the value of the 'value' attribute will be displayed as a label if no 'label'... -
Problem with fopen("php://input", "r")
Hello there, I am having problem opening the in-built php stream php://input According to the manual this has been integrated into php since... -
"Start" "Program" "Menu" list is empty
For what ever reason my list of installed programs in my "Start" "Programs" menu is empty. Anyone know how to restore the list. Thanks for your... -
Aaron [SQL Server MVP] #2
Re: SQL "Where" Problem in ASP
How about:
db = Server.MapPath("spirit.mdb")
Set adoCon = CreateObject("ADODB.Connection")
adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & db
strSQL = "SELECT * FROM Characters WHERE Server = 'test'"
Set rsDatabase = adoCon.Execute(strSQL)
Changes:
(a) avoiding an explicit ADODB.Recordset when unwarranted
[url]http://www.aspfaq.com/2191[/url]
(b) avoiding ODBC/DSN
[url]http://www.aspfaq.com/2126[/url]
Recommended further change: stop using SELECT *!
[url]http://www.aspfaq.com/2096[/url]
--
[url]http://www.aspfaq.com/[/url]
(Reverse address to reply.)
"Toytown" <teh-billy@microsoft.com> wrote in message
news:_eAIc.26689$xi3.12320@fe18.usenetserver.com.. .trying> Hi
>
> I just noticed this on my site the other day and its driving my crazyhowever> to fix it. The ASP pages connect to a ACCESS database and attempt to get
> records using sample code like the one below. Since January this has
> worked without any issues (and continues to work on my test server)the> it no longer works on the live server, the only updates i have done are2000> windows ones and these are the only changes that have been made to the
> server.
>
>
> This code works on test but not on the live server (both are using winI> server)
>
> Set adoCon = Server.CreateObject("ADODB.Connection")
> adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
> Server.MapPath("spirit.mdb")
> Set rsDatabase = Server.CreateObject("ADODB.Recordset")
> strSQL = "SELECT * FROM Characters WHERE Server = 'test'"
> rsDatabase.Open strSQL, adoCon
>
> If i change the code to the following then the code works correctly but i
> need the WHERE statement to select the correct records.
>
> Set adoCon = Server.CreateObject("ADODB.Connection")
> adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
> Server.MapPath("spirit.mdb")
> Set rsDatabase = Server.CreateObject("ADODB.Recordset")
> strSQL = "SELECT * FROM Characters"
> rsDatabase.Open strSQL, adoCon
>
> The error message i get back using the first example is, which off course
> dosent help at all
> Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
> [Microsoft][ODBC Microsoft Access Driver] Unknown
> /testdb.asp, line 7
>
> I have tried the following on the live server.
> 1. Reinstall MDAC 2.8
> 2. Reinstall Service Pack 4
> 3. Remove/Reinstall IIS
> 4. Reinstall Jet Service Pack 8
>
> none of these fix it, can anybody give me any clues as to where to look?> cant reinstall the OS!
>
>
>
Aaron [SQL Server MVP] Guest
-
Bob Barrows [MVP] #3
Re: SQL "Where" Problem in ASP
Toytown wrote:
I can't find the word in any of the lists I have, but from the symptoms, I> strSQL = "SELECT * FROM Characters WHERE Server = 'test'"
> rsDatabase.Open strSQL, adoCon
suspect "Server" may be a reserved keyword. In addition to the changes Aaron
recommended, I suggest surrounding the word with brackets:
" ... [Server] = 'test'"
HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Bob Barrows [MVP] Guest
-
Aaron [SQL Server MVP] #4
Re: SQL "Where" Problem in ASP
> I suggest surrounding the word with brackets:
Or renaming the column. ;-)
A
Aaron [SQL Server MVP] Guest
-
Toytown #5
Re: SQL "Where" Problem in ASP
Just to let you know, im going to make the changes identified above and see
if they fix it, but also that any of the fields (server etc) will cause the
same issue.
Also why does this still work on one system and not another?
And why would one stop working, unless one of the updates screwed it?
"Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:OzmQxKEaEHA.2520@TK2MSFTNGP12.phx.gbl...>> > I suggest surrounding the word with brackets:
> Or renaming the column. ;-)
>
> A
>
>
Toytown Guest
-
Toytown #6
Re: SQL "Where" Problem in ASP
"Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:uC6ihzDaEHA.2944@TK2MSFTNGP11.phx.gbl...> How about:
>
> db = Server.MapPath("spirit.mdb")
> Set adoCon = CreateObject("ADODB.Connection")
> adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & db
> strSQL = "SELECT * FROM Characters WHERE Server = 'test'"
> Set rsDatabase = adoCon.Execute(strSQL)
>
I get exactly the same error :( using the above code, im sure the server is
screwed somehow, but is there any idea of how i can get it working
again?even if i use a different database or field name (server) i still get
the same problem. I really appreciate the help BTW.
Microsoft JET Database Engine error '80040e14'
Unknown
/testdb2.asp, line 6
Toytown Guest
-
Aaron [SQL Server MVP] #7
Re: SQL "Where" Problem in ASP
> Also why does this still work on one system and not another?
Probably because one of the updates "screwed it"... what updates are you> And why would one stop working, unless one of the updates screwed it?
talking about, btw?
--
[url]http://www.aspfaq.com/[/url]
(Reverse address to reply.)
Aaron [SQL Server MVP] Guest
-
Toytown #8
Re: SQL "Where" Problem in ASP
The only updates to the server before it stopped working were the typical
windows ones, through windows update. The ones i remember off hand were
the JET update and the ADODB stream problem update. Like my previous
message even using your sample code didnt work......however it works on my
other system........any other clues before i give up on it. Again it works
until i enter the WHERE part of the SQL string and then it gives up :(
Thanx for all your help!!
"Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:OQKQpdEaEHA.2016@TK2MSFTNGP09.phx.gbl...>> > Also why does this still work on one system and not another?
> > And why would one stop working, unless one of the updates screwed it?
> Probably because one of the updates "screwed it"... what updates are you
> talking about, btw?
>
> --
> [url]http://www.aspfaq.com/[/url]
> (Reverse address to reply.)
>
>
Toytown Guest



Reply With Quote

