Please help! Can't get any output from ado co

Results 1 to 2 of 2

Thread: Please help! Can't get any output from ado co

  1. #1
    sterling Guest

    Default Please help! Can't get any output from ado co

    This has become very frustrating for me! I am new to ASP and have tried everything to connect to the NWIND.mdb database in my c: directory--DSN configurations, DSN-less...several variations of both, thinking I was doing something wrong. No matter what I&#039;ve tried, after setting up a recordset, I cannot get any output to display on my page. I&#039;m not even sure I&#039;m making the connection. I even downloaded an ASP database example with the database, connection, recordset, and output code already written. When I run that, again, no output. <BR><BR>I am running windows 2000 and have installed IIS 5. <BR><BR>Here is an example of the code I have tried:<BR><BR><BR><BR>&#039; connection<BR><BR>Set cnDB=server.createobject("adodb.connection")<BR>cn DB.ConnectionString="Provider=Microsoft.Jet.OLEDB. 4.0;" _<BR> & "Data Source=c:
    wind.mdb"<BR>cnDB.Open<BR><BR>&#039; recordset<BR><BR>Set rsQuery=server.createobject("adodb.recordset")<BR> rsQuery.Open "SELECT * FROM Shippers", _<BR> cnDB<BR><BR>&#039; display<BR><BR>Do Until rsQuery.EOF = true<BR>response.write rsQuery("Name")<BR>response.write rsQuery("Phone")<BR>rsQuery.MoveNext<BR>Loop<BR><B R><BR>I&#039;ve tried other connection objects, as well. Making a System DSN reference (called "NWIND" and making cnDB.connectionstring = "DSN=NWIND". I simply cannot get anything to work and am wondering if something is wrong with my system configuration.<BR><BR>Can anyone help?<BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Please help! Can't get any output from ad

    I am assuming that your db tables are ok and u have a DSN setup as "nwind" to point to where ever your database exists.<BR><BR>try the following:<BR><BR>set myConn = Server.CreateObject("ADODB.Connection")<BR>myConn. open("nwind")<BR><BR>myQry = "select * from Shippers"<BR>set myRs = myConn.execute(myQry)<BR><BR>do while not myRs.EOF<BR><BR>&#060;%=myRs("Name")%&#062;<BR><BR >myRs.movenext<BR>Loop<BR><BR><BR><BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts