Please he lp with first OLE db connection

Results 1 to 2 of 2

Thread: Please he lp with first OLE db connection

  1. #1
    Join Date
    Dec 1969

    Default Please he lp with first OLE db connection

    I want to connect to a flat file DBASE IV db011.dbf then show all fields. It should be real easy but i am not declaring my fields proper in the Select area, VID or IIS won&#039t tell me what I am doing wrong. Thank You In Advanced...<BR><BR>&#060;%<BR>dim oConn<BR>dim oRs<BR>dim vCS<BR>dim sqltext<BR><BR>set oConn=Server.CreateObject("ADODB.connection")<BR>v CS = "Provider=Microsoft.Jet.OLEDB.4.0"<BR>vCS = vCS & "; Data Source=f:InetPubwwwGiddingsGasControldb011.dbf"<BR >oConn.ConnectionString = vCS<BR>oConn.Open<BR><BR>%&#062;<BR><BR>&#060;%<BR >set oRs = Server.CreateObject("ADODB.recordset")<BR>sqltxt = "SELECT * FROM [db011]"<BR>oRS.Open sqltxt,oConn<BR>Do until oRS.EOF<BR>Response.Write oRS("vCS") & "<BR>"<BR>oRS.MoveNext<BR>Loop &#039each record<BR><BR>&#060;%<BR> sql = "SELECT * FROM [DB011]"<BR> If cstr(Param) &#060;&#062; "" And cstr(Data) &#060;&#062; "" Then<BR> sql = sql & " WHERE [" & cstr(Param) & "] = " & cstr(Data)<BR> End If<BR> Set rs = Server.CreateObject("ADODB.Recordset")<BR> rs.Open sql, conn, 3, 3<BR>%&#062;<BR><BR>&#060;/body&#062;<BR>&#060;/html&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Please he lp with first OLE db connection

    change your do while loop to a for next loop.<BR><BR>For i = 0 to oRS.fields.count -1<BR><BR>and change your Response.Write oRS("vCS") to <BR><BR>response.write oRS.fields(i).value<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