I have a problem with my ODBC connection. I keep getting this error:

Warning: SQL error: [Microsoft][ODBC Driver Manager] Invalid string or buffer length, SQL state S1090 in SQLConnect in d:\htdocs\exchange2\search.php on line 4

I did a odbc_connect("DSN=MyDBase;UID=Myname;PWD=hello","","")

However, I keep getting this error. I even added a SQL_CUR_USE_ODBC as the 4th parameter and it still doesn't work. Could anyone please help me?

Sincerely,
Letitia.

    You should do

    odbc_connect("MyDBase", "Myname", "hello" )

    Regards

    Yaron Yogev

    Letitia wrote:

    I have a problem with my ODBC connection. I keep getting this error:

    Warning: SQL error: [Microsoft][ODBC Driver Manager] Invalid string or buffer length, SQL state S1090 in SQLConnect in d:\htdocs\exchange2\search.php on line 4

    I did a odbc_connect("DSN=MyDBase;UID=Myname;PWD=hello","","")

    However, I keep getting this error. I even added a SQL_CUR_USE_ODBC as the 4th parameter and it still doesn't work. Could anyone please help me?

    Sincerely,
    Letitia.

      Thank you for your prompt reply.

      However, I've tried that odbc_connect("MyDBase", "Myname", "hello" ) and I got an error message saying:

      Warning: SQL error: [IBM][Client Access ODBC Driver (32-bit)][DB2/400 SQL]Communication link failure. COMM RC=0x5, SQL state 08S01 in SQLConnect in d:\htdocs\exchange2\search.php on line 4

      Did anyone had an error message like this before?

      Sincerely,
      Letitia.

        Letitia,

        Do you have a DSN called "MyDBase" ? If so, have you testted it successfully? Are your login name and password correct for this DSN?

        Here's what I do when I create a new database (I'm using NT 4 SP 6 with MS SQL Server):
        I click "Start", "Settings", "Control Panel", and then "Data Sources (ODBC)".
        I select the "System DSN" tab and then I click "Add...".
        I select the appropriate driver type, choose a name for the new DSN and the database server to connect to.
        (Followed by some other setting screens which may differ depending on the type of driver used)
        In the end I click Finish and get a screen with a button "Test Data Source...". I click it and if all is well I get a message "TESTS COMPLETED SUCCESSFULLY!".

        If you get past this stage everything else should work OK for you.

        Regards,

        Yaron Yogev

          Write a Reply...