Discussion:
Opening ODBC with VS2005 Beta2
(too old to reply)
wramos1
2005-07-15 21:09:45 UTC
Permalink
When i try to open the connection to the ODBC Driver in VB2k5Beta I get
the following error.


An error occurred while retrieving the information from the database:
Column 'TABLE_CAT' does not belong to table Tables.

Is there something i can do to open the driver so i can select say USERNDS
Table?
Susan Perrin
2005-07-29 23:48:19 UTC
Permalink
Hi

Do you know that this is a new problem to VS2005 beta? Can you post your
code?

Thank you
Susan
wramos1
2005-08-04 15:28:22 UTC
Permalink
Post by Susan Perrin
Hi
Do you know that this is a new problem to VS2005 beta? Can you post your
code?
Thank you
Susan
I cant even get that far, I try and use the odbc objects and I get an
error immediatly.
Plus I am very interested in writing for vb.net and need more info on how
to setup my compiler. I know thats probably in a different forum. But cant
find that info either.
One other note, I can open the table with excel and Brio Query.
wramos1
2005-08-04 15:27:26 UTC
Permalink
Post by Susan Perrin
Hi
Do you know that this is a new problem to VS2005 beta? Can you post your
code?
Thank you
Susan
I cant even get that far, I try and use the odbc objects and I get an
error immediatly.

Plus I am very interested in writing for vb.net and need more info on how
to setup my compiler. I know thats probably in a different forum. But cant
find that info either.
wramos1
2005-08-09 15:36:34 UTC
Permalink
Post by wramos1
When i try to open the connection to the ODBC Driver in VB2k5Beta I get
the following error.
Column 'TABLE_CAT' does not belong to table Tables.
Is there something i can do to open the driver so i can select say USERNDS
Table?
Some more information:

I tell VB to build the connection string and this is the string that
causes the error.
Dsn=CanardNDS;dbq=NDS:\CANARD_TREECANARD;server=NotTheServer;uid=wramos.net-tech.mia.canard

My thinking is that, dbq should be pointing to the table defs, and that
there should be a seperate entry for the NDS Tree. IE: dbq=NDS\UserNDS
However again all i need so far is someone to connect from vb into the
odbc using visual studio 5
Susan Perrin
2005-08-10 23:37:04 UTC
Permalink
I've been assuming that it's a specific problem with VB2005, so I'm trying
to get ahold of a copy.

Have you tried VB6? Does it work there? It works for me in VB6 with the
following:

DefaultType = dbUseODBC
Set wkspc = CreateWorkspace("ODBCWorkspace", "", "", dbUseODBC)
Set cn = wkspc.OpenConnection("MyConn", dbDriverNoPrompt, False,
"ODBC;DSN=Default NDS Database;")

Thank you
Susan
wramos1
2005-08-12 13:41:22 UTC
Permalink
Post by Susan Perrin
I've been assuming that it's a specific problem with VB2005, so I'm trying
to get ahold of a copy.
Have you tried VB6? Does it work there? It works for me in VB6 with the
DefaultType = dbUseODBC
Set wkspc = CreateWorkspace("ODBCWorkspace", "", "", dbUseODBC)
Set cn = wkspc.OpenConnection("MyConn", dbDriverNoPrompt, False,
"ODBC;DSN=Default NDS Database;")
Thank you
Susan
No I dont have access to vb6.
Susan Perrin
2005-08-13 00:02:39 UTC
Permalink
Hi

Thanks for your patience. I got a copy of VB 2005 beta 2 and I see the
error using the GUI setup for data connection. If you have a contact at
Microsoft for your beta feedback, I'm happy to work with them to determine
the problem. I don't see anything useful in the trace and no errors come
back from the driver, so they're probably looking for a non implemented
feature. It would be nice if you could set sql version information.

However I had no problem coding direct to the driver using the following
(you have to add the system.data as a reference)

Imports System.Data.Odbc

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim conn As OdbcConnection
Dim comm As OdbcCommand
Dim connstring As String
Dim sql As String
Dim reader As OdbcDataReader


Try
connstring = "DSN=Default NDS Database;"
sql = "Select NDS_Name from UserNDS"
conn = New OdbcConnection(connstring)
conn.Open()
comm = conn.CreateCommand()
comm.CommandText = sql
reader = comm.ExecuteReader()
While reader.Read()
MessageBox.Show("NDS_Name: " & reader("NDS_Name"))
End While

Catch ex As Exception
MessageBox.Show(ex.Message)


End Try



End Sub
End Class

Thank you
Susan
wramos1
2005-08-15 19:14:29 UTC
Permalink
Post by Susan Perrin
Hi
Thanks for your patience. I got a copy of VB 2005 beta 2 and I see the
error using the GUI setup for data connection. If you have a contact at
Microsoft for your beta feedback, I'm happy to work with them to determine
the problem. I don't see anything useful in the trace and no errors come
back from the driver, so they're probably looking for a non implemented
feature. It would be nice if you could set sql version information.
However I had no problem coding direct to the driver using the following
(you have to add the system.data as a reference)
Imports System.Data.Odbc
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim conn As OdbcConnection
Dim comm As OdbcCommand
Dim connstring As String
Dim sql As String
Dim reader As OdbcDataReader
Try
connstring = "DSN=Default NDS Database;"
sql = "Select NDS_Name from UserNDS"
conn = New OdbcConnection(connstring)
conn.Open()
comm = conn.CreateCommand()
comm.CommandText = sql
reader = comm.ExecuteReader()
While reader.Read()
MessageBox.Show("NDS_Name: " & reader("NDS_Name"))
End While
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
End Class
Thank you
Susan
I tried your method, however imports System.Data.ODBC wouldnt work for me,
After I typed System. It couldnt find the class DATA. not sure why. Did
you have any other imports that you had to do?
Susan Perrin
2005-08-23 16:00:38 UTC
Permalink
Hi

Did you add the reference? Project/add reference/system.data under the .net
tab...

Thank you
Susan

Loading...