Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Posts
    1

    Unanswered: Text Field Problems

    I think I've narrowed the problem down to a text field - and I need the field to be bigger than 255 characters.

    I'm trying to access a previously created record on an ASP page using the myOLEDB provider. I had previously tried myODBC. I am trying to use a disconnected recordset.

    I get various error messages after I've created a record in a table that contains a text (or a mediumtext) field - when trying to read that record. I have tried 3.23 and 3.23-max with various other table types. Currently the error message is "Provider error '80040e37' Table does not exist" - but as soon as I switch the field to varchar(255), it works. Under myODBC I believe I was usually getting an error like "Data Provider returned an E_FAIL message" or something like that.

    If I use a different table that doesn't have a text field, or change the text field back to varchar(255), it works.

    Any suggestions? What can I do?

    Below is the relevant code (ASP/JScript). Error occurs at oRS.Open( oCmd ) in getRS( ).

    var oConn = getConn( getDSN( ), false );
    var oRS = getRS( oConn, "SELECT * FROM tblMessage" );
    out( oRS.RecordCount );
    cleanUp( oRS, oConn );

    getDSN( ) returns "PROVIDER=MySQLProv;Data Source=<database>;User ID=<uid>;Password=<password>"

    getConn looks like this:

    function getConn( sDSN, bNoClient ) {
    var oConn = Server.CreateObject( "ADODB.Connection" );
    if( !bNoClient ) oConn.CursorLocation = adUseClient;
    oConn.open( sDSN );
    return oConn;
    }

    getRS looks like this:

    function getRS( oConn, sSQL ) {
    var oRS = Server.CreateObject( "ADODB.RecordSet" );
    var oCmd = Server.CreateObject( "ADODB.Command" );

    with( oRS ) {
    CursorLocation = adUseClient;
    CursorType = adOpenStatic;
    LockType = adLockOptimistic;
    } // end with( oRS )

    with( oCmd ) {
    ActiveConnection = oConn;
    CommandText = sSQL;
    CommandType = adCmdText;
    } // end with( oCmd )

    oRS.Open( oCmd ); // error occurs here at the moment

    DisconnectCmd( oCmd );
    DisconnectRecordset( oRS );
    oCmd = null;

    return oRS;
    }

    DisconnectCmd and DisconnectRecordSet call VBScript functions that perform the disconnect, since I can't do that from JScript.

  2. #2
    Join Date
    Jan 2004
    Posts
    1

    Re: Text Field Problems

    ex)
    database : dt1
    tablename : tb1

    query : "select text_column from dt1.tb1 where ...";



    Originally posted by bkavanaugh
    I think I've narrowed the problem down to a text field - and I need the field to be bigger than 255 characters.

    I'm trying to access a previously created record on an ASP page using the myOLEDB provider. I had previously tried myODBC. I am trying to use a disconnected recordset.

    I get various error messages after I've created a record in a table that contains a text (or a mediumtext) field - when trying to read that record. I have tried 3.23 and 3.23-max with various other table types. Currently the error message is "Provider error '80040e37' Table does not exist" - but as soon as I switch the field to varchar(255), it works. Under myODBC I believe I was usually getting an error like "Data Provider returned an E_FAIL message" or something like that.

    If I use a different table that doesn't have a text field, or change the text field back to varchar(255), it works.

    Any suggestions? What can I do?

    Below is the relevant code (ASP/JScript). Error occurs at oRS.Open( oCmd ) in getRS( ).

    var oConn = getConn( getDSN( ), false );
    var oRS = getRS( oConn, "SELECT * FROM tblMessage" );
    out( oRS.RecordCount );
    cleanUp( oRS, oConn );

    getDSN( ) returns "PROVIDER=MySQLProv;Data Source=<database>;User ID=<uid>;Password=<password>"

    getConn looks like this:

    function getConn( sDSN, bNoClient ) {
    var oConn = Server.CreateObject( "ADODB.Connection" );
    if( !bNoClient ) oConn.CursorLocation = adUseClient;
    oConn.open( sDSN );
    return oConn;
    }

    getRS looks like this:

    function getRS( oConn, sSQL ) {
    var oRS = Server.CreateObject( "ADODB.RecordSet" );
    var oCmd = Server.CreateObject( "ADODB.Command" );

    with( oRS ) {
    CursorLocation = adUseClient;
    CursorType = adOpenStatic;
    LockType = adLockOptimistic;
    } // end with( oRS )

    with( oCmd ) {
    ActiveConnection = oConn;
    CommandText = sSQL;
    CommandType = adCmdText;
    } // end with( oCmd )

    oRS.Open( oCmd ); // error occurs here at the moment

    DisconnectCmd( oCmd );
    DisconnectRecordset( oRS );
    oCmd = null;

    return oRS;
    }

    DisconnectCmd and DisconnectRecordSet call VBScript functions that perform the disconnect, since I can't do that from JScript.

Posting Permissions

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