Hi

I am trying to get Data from ODBC into a Datagrid.

This is the very simple code i am using:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim odbcConn As New
Data.Odbc.OdbcConnection("DSN=Muschi;DBQ=X:\SBDATEN;SERVER=NotTheServer")

'odbcConn.ConnectionString = "DRIVER={Superbase 32-bit Driver
(*.sbf)};DBQ=X:\SBDATEN;SERVER=NotTheServer"

'odbcConn.Open()

Dim DataAdapter As New Data.Odbc.OdbcDataAdapter("Select * from SMSVERS",
odbcConn)

Dim ds As New DataSet

DataAdapter.Fill(ds)

DataGrid1.DataSource = ds

End Sub



When the command DataAdapter.Fill(ds) is executed the following exeption is
throwm:


An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred
in system.data.dll

Additional information: Specified argument was out of the range of valid
values.



When I import to access with the same connection i do not have any
problems...

Do I make something wrong?

Thanks for every help!

Nijazi Halimaji

Re: Problems with ODBC by Paul

Paul
Thu Sep 01 11:06:56 CDT 2005

On Thu, 1 Sep 2005 14:43:55 +0200, "Nijazi Halimaji" <spami@gmx.net> wrote:

¤ Hi
¤
¤ I am trying to get Data from ODBC into a Datagrid.
¤
¤ This is the very simple code i am using:
¤
¤ Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
¤ System.EventArgs) Handles Button1.Click
¤
¤ Dim odbcConn As New
¤ Data.Odbc.OdbcConnection("DSN=Muschi;DBQ=X:\SBDATEN;SERVER=NotTheServer")
¤
¤ 'odbcConn.ConnectionString = "DRIVER={Superbase 32-bit Driver
¤ (*.sbf)};DBQ=X:\SBDATEN;SERVER=NotTheServer"
¤
¤ 'odbcConn.Open()
¤
¤ Dim DataAdapter As New Data.Odbc.OdbcDataAdapter("Select * from SMSVERS",
¤ odbcConn)
¤
¤ Dim ds As New DataSet
¤
¤ DataAdapter.Fill(ds)
¤
¤ DataGrid1.DataSource = ds
¤
¤ End Sub
¤
¤
¤
¤ When the command DataAdapter.Fill(ds) is executed the following exeption is
¤ throwm:
¤
¤
¤ An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred
¤ in system.data.dll
¤
¤ Additional information: Specified argument was out of the range of valid
¤ values.
¤
¤
¤
¤ When I import to access with the same connection i do not have any
¤ problems...
¤
¤ Do I make something wrong?
¤
¤ Thanks for every help!


Is there a reason why the Connection object's Open statement is commented out?


Paul
~~~~
Microsoft MVP (Visual Basic)

Re: Problems with ODBC by Nijazi

Nijazi
Fri Sep 02 01:49:08 CDT 2005

Hi

I have commented it out for testing, but the code didn't work with open
too...

Thanks

Nijazi Halimaji
"Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> schrieb im
Newsbeitrag news:nk9eh1dls9ts5oh31vn2s3app02emkje2i@4ax.com...
> On Thu, 1 Sep 2005 14:43:55 +0200, "Nijazi Halimaji" <spami@gmx.net>
> wrote:
>
> ¤ Hi
> ¤
> ¤ I am trying to get Data from ODBC into a Datagrid.
> ¤
> ¤ This is the very simple code i am using:
> ¤
> ¤ Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> ¤ System.EventArgs) Handles Button1.Click
> ¤
> ¤ Dim odbcConn As New
> ¤
> Data.Odbc.OdbcConnection("DSN=Muschi;DBQ=X:\SBDATEN;SERVER=NotTheServer")
> ¤
> ¤ 'odbcConn.ConnectionString = "DRIVER={Superbase 32-bit Driver
> ¤ (*.sbf)};DBQ=X:\SBDATEN;SERVER=NotTheServer"
> ¤
> ¤ 'odbcConn.Open()
> ¤
> ¤ Dim DataAdapter As New Data.Odbc.OdbcDataAdapter("Select * from
> SMSVERS",
> ¤ odbcConn)
> ¤
> ¤ Dim ds As New DataSet
> ¤
> ¤ DataAdapter.Fill(ds)
> ¤
> ¤ DataGrid1.DataSource = ds
> ¤
> ¤ End Sub
> ¤
> ¤
> ¤
> ¤ When the command DataAdapter.Fill(ds) is executed the following exeption
> is
> ¤ throwm:
> ¤
> ¤
> ¤ An unhandled exception of type 'System.ArgumentOutOfRangeException'
> occurred
> ¤ in system.data.dll
> ¤
> ¤ Additional information: Specified argument was out of the range of valid
> ¤ values.
> ¤
> ¤
> ¤
> ¤ When I import to access with the same connection i do not have any
> ¤ problems...
> ¤
> ¤ Do I make something wrong?
> ¤
> ¤ Thanks for every help!
>
>
> Is there a reason why the Connection object's Open statement is commented
> out?
>
>
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)



Re: Problems with ODBC by Paul

Paul
Fri Sep 02 08:08:47 CDT 2005

On Fri, 2 Sep 2005 08:49:08 +0200, "Nijazi Halimaji" <spami@gmx.net> wrote:

¤ Hi
¤
¤ I have commented it out for testing, but the code didn't work with open
¤ too...
¤

I'm not very familiar with Superbase so I can't verify the connection string syntax. You mention you
can connect through Access. Can you connect from code using ADO in Access or Visual Basic using one
of the connection strings you posted?


Paul
~~~~
Microsoft MVP (Visual Basic)