Fredrick Bartlett
3/31/2002 5:09:00 PM
There is a hot fix for the ODBC32.dll. Variable length fields (VarChar,
Text) etc. with a null value will raise an error. The fix is not available
in the public domain. I spent about an hour with Developer Support trying to
get it. After several transfers a rep gave me the correct phone number(not
listed in support directory) If you EMail me I will give you the directions
necessary to get it.
"doctor doctor" <g_o_d99@hotmail.com> wrote in message
news:eBKG#IH2BHA.1324@tkmsftngp03...
> The following code:
>
> Dim cn As OdbcConnection, strConnString
> strConnString =
>
"driver=MySQL;DATABASE=Photos;SERVER=localhost;UID=root;PWD=root;PORT=3306;O
> PTION=512;"
> cn = New OdbcConnection(strConnString)
> Dim myString As String = "Select * from pictures"
> Dim cmd As OdbcCommand = New OdbcCommand(myString)
> Dim da As New OdbcDataAdapter("select * from pictures", "dsn=cn")
> Dim ds As New DataSet()
> da.Fill(ds, "pictures")
> DataGrid1.DataSource = ds.Tables("pictures").DefaultView
>
> generates this error at the da.Fill command:
>
> An unhandled exception of type 'Microsoft.Data.Odbc.OdbcException'
occurred
> in microsoft.data.odbc.dll
>
> Additional information: System error.
>
> The equivalent code runs fine as an aspx file:
>
> <script language="C#" runat="server">
> protected void Page_Load(Object sender, EventArgs e)
> {
> string mySQLConnStr = "driver={MySQL};";
> mySQLConnStr = mySQLConnStr + "server=localhost;";
> mySQLConnStr = mySQLConnStr + "uid=root;";
> mySQLConnStr = mySQLConnStr + "pwd=root;";
> mySQLConnStr = mySQLConnStr + "database=Photos;";
> mySQLConnStr = mySQLConnStr + "OPTION=17923";
> OdbcConnection myConnection = new OdbcConnection
> (mySQLConnStr);
> string SQL = "select * from pictures";
> OdbcDataAdapter myCommand = new OdbcDataAdapter(SQL,
> myConnection);
> DataSet ds = new DataSet();
> myCommand.Fill(ds, "pictures");
> MyDataGrid.DataSource=ds.Tables["pictures"].DefaultView;
> MyDataGrid.DataBind();
> }
> </script>
>
> ????
>
>
>