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

Database loop and error

Status
Not open for further replies.

vans

Programmer
Apr 23, 2001
12
am trying to open a database run a loop through the data, then have an if statement within the first loop that opens a second database and retreives some data.

When I run the code listed below I receive the following

Here is my error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Visual FoxPro Driver]Memo file c:\inetpub\ is missing or is invalid.
/sasixp/grades.asp, line 45

LINE 45 is oRSp3.Open
I never all c:\inetpub\ (the error above is exact and spelled correctly). I am puzzled.

Here is my code:

<!--#include File=&quot;adovbs.inc&quot;-->
<%
dim oConn
dim oRSp
Set oConn=Server.CreateObject(&quot;ADODB.connection&quot;)
Set oRSp=server.createobject(&quot;ADODB.recordset&quot;)
oConn.Open &quot;Driver={Microsoft Visual FoxPro Driver};&quot; & _
&quot;SourceType=DBF;&quot; & _
&quot;SourceDB=c:\Inetpub\ & _
&quot;Exclusive=No;&quot;
oRSp.Open &quot;Select * From astu0021.dbf WHERE Status <> 'I' AND Status <> 'N' AND SocSecNum='&quot; & Session(&quot;password&quot;) &&quot;'&quot;, oConn, , ,adCmdText
response.write &quot;<table border=0><tr><td width=600 bgcolor=darkblue><font color=white>Student Information</font>&quot;
do while NOT oRSp.EOF
response.write &quot;<table bgcolor=white border=0>&quot;
response.write &quot;<tr><td width=150><b>Student Name</b></td><td width=450>&quot; & oRSp(&quot;firstname&quot;) & oRSp(&quot;middlename&quot;) & oRSp(&quot;lastname&quot;) & &quot;</td></tr>&quot;
response.write &quot;<tr><td width=150><b>Department</b></td><td width=450>&quot; & oRSp(&quot;Department&quot;)& &quot;</td></tr>&quot;
response.write &quot;<tr><td width=150><b>Grade</b></td><td width=450>&quot; & oRSp(&quot;Grade&quot;)& &quot;</td></tr>&quot;
dim oConn2
dim oRSp2,oRSp3,course
Set oConn2=Server.CreateObject(&quot;ADODB.connection&quot;)
Set oRSp2=server.createobject(&quot;ADODB.recordset&quot;)
Set oRSp3=Server.CreateObject(&quot;ADODB.RecordSet&quot;)
oConn2.Open &quot;Driver={Microsoft Visual FoxPro Driver};&quot; & _
&quot;SourceType=DBF;&quot; & _
&quot;SourceDB=c:\Inetpub\ & _
&quot;Exclusive=No;&quot;
Set oRSp2.ActiveConnection=oConn2
oRSp2.Source=&quot;Select * From agrd0021.dbf WHERE Stulink = &quot; & Session(&quot;Stulink&quot;) & &quot;ORDER BY BeginPrd&quot;
oRSp2.Open
do while NOT oRSp2.EOF
response.write &quot;<tr><td width=150>&quot; & oRSp2(&quot;BeginPrd&quot;)
course=oRSp2(&quot;Course&quot;)
oRSp2.MoveNext

Set oRSp3.ActiveConnection=oConn2
oRSp3.Source=&quot;Select * From acrs0021.dbf WHERE Course = &quot; & course
oRSp3.Open
response.write &quot;</td><td width=450>&quot; & oRSp3(&quot;Title&quot;) & &quot;</td></tr>&quot;
oRSp3.close
set oRSp3=nothing

Loop
oRSp2.Close
set oRSp2=nothing


oConn2.close
Set oConn2=Nothing
response.write &quot;</table><hr>&quot;
oRSp.MoveNext
Loop
oRSp.close
set oRSp=nothing
oConn.close
set oConn=nothing
response.write&quot;</td></tr></table>&quot;
%>
 
Sounds like it's a problem with your database connection string. Write a simple test page to see if you can hit your database or not.
 
It sounds like you have a memo field in the table and whe you do your select with &quot;Select * From astu0021.dbf&quot; it is also looking for the memo field file. You might get around it by selecting each field separately and exclude the memo field or make sure the memo field file is store with the dbf.

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top