Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Location
    Chennai
    Posts
    2

    Question Database Connection

    I am getting the following error while attempting to connect to a
    database

    Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
    ODBC driver does not support the requested properties.
    /g2gx/listrecords.asp, line 107

    Here is the code i had used

    <%
    set con=server.createobject("adodb.connection")
    set listRs=server.CreateObject("adodb.recordset")
    con.open "DSN=MyData"
    dim sql

    If Request.Form("select1")="All" Then
    sql="select * from details where Status=1 ORDER BY Id_no"
    ElseIf Request.Form("select1")="Name" Then
    sql = "select * from details where Name like '" & criteria & "%' and Status=1 ORDER BY Id_no"
    ElseIf Request.Form("select1")="Company" Then
    sql="select * from details where Company like '" & criteria & "%' and Status=1 ORDER BY Id_no"
    ElseIf Request.Form("select1")="Phone" Then
    sql="select * from details where Phone like '" & criteria & "%' and Status=1 ORDER BY Id_no "
    End If
    listRs.Open sql,con,1
    %>
    ...................
    ..................
    ....................
    <%
    If listRs.BOF = False and listRs.EOF = False Then
    dim i
    i = 1
    While not listRs.EOF
    %>
    <tr vAlign=top>
    <td width="37" rowspan="2"><font face="Verdana, Arial, Helvetica,
    sans-serif" size="2"><%=listRs("Id_no")%></font>
    </td>
    <td width="147"><font face="Verdana, Arial, Helvetica, sans-serif"
    size="2"><%=listRs("Name")%></font>
    </td>
    <td width="100" rowspan="2">&nbsp;</td>
    <td width="200" rowspan="2">&nbsp;</td>
    <td width="89" rowspan="2">&nbsp;</td>
    <td width="62" rowspan="2">&nbsp;</td>
    <td width="66" rowspan="2">
    <P align=center>
    <INPUT id=checkbox1 type=checkbox name=checkbox
    value="<%=listRs("Id_no")%>">
    </P></td>
    </tr>
    <tr vAlign=top>
    <td width="147" height="5">
    <input type="text" name="textfield" value="<%=listRs("Email")%>">
    </td>
    </tr>
    <%
    i=i+1
    listRs.movenext
    wend
    End if
    %>

    ................................
    ................................
    ................................
    ................................


    Can anybody help me in this regard

    Regards

    RAGESH

  2. #2
    Join Date
    Oct 2002
    Location
    Baghdad, Iraq
    Posts
    697

    Re: Database Connection

    Post it in the ASP section, and at least give people a clue where line 107 is.

Posting Permissions

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