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

Problem Displaying Recordset from Access DB

Status
Not open for further replies.

scripter73

Programmer
Apr 18, 2001
421
US
Hi,

I'm having trouble displaying the contents of my recordset. My ASP script connects to my DSN called 'webreport'. This file is on a server drive D:\. D:\ is the physical drive on the server. My client machine has full privileges to it.

It seems I'm able to open my connection alright, but when I attempt to execute my SQL query, I get the error '80004005 - Unspecified error' on my set rs = myconn.execute(sqltext). I know this error can mean several different things, from permissions to illegal usage of objects, but I'm sort of new to ASP and I'm not an NT Admin. :)

I've done quite a bit of research, and I've given my ISUR_<machinename> full access to both the database I'm connecting to, and the directory where both the database and my ASP script reside. I just can't seem to make this out.

Following is my code:



<html><head><title>Reading Contents of Database</title></head>
<body>
<%
'**************************
'OPEN DATABASE CONNECTION
'**************************
'create connection to database using dsn
set myconn = Server.CreateObject(&quot;ADODB.Connection&quot;)
myconn.open &quot;FILEDSN=d:\inetpub\
'search database with query
sqltext = &quot;SELECT * FROM Access-log&quot;
set rs = myconn.execute(sqltext)

While Not rs.eof
response.write &quot;<br>&quot; & rs(&quot;IP_Address&quot;) & rs(&quot;User_ID&quot;) & &quot;<br>&quot;
rs.movenext
WEnd

rs.close
myconn.close
%>
</body>
</html>



Thanks in advance for your help. I really appreciate it.

scripter73
 
where Access-log is the name of your table, eh??

And it's definitely the name of the table?

Try:
sqltext = &quot;SELECT * FROM [Access-log]&quot;

maybe that hyphen is confusing it.

lemme know -
Paul Prewett
 
Hi Paul,

That was it! I renamed it Alog and I'm able to get to my recordset!

Thanks,
scripter73
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top