Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : VB.NET Connection FailSearch Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC SQL Support Forum

 New Topic 
 
 Post Reply 
[1]  
 VB.NET Connection Fail 
 Author   Message 
  Moliver 
  
 Group: Members 
 Posts: 7 
 Joined: 2006-11-10 
 Profile
 Posted : 2006-11-10 14:19:12

This is the connection I am trying to establish in Visual Studio 2005 using VB.NET:

Dim cnQODBC As System.Data.Odbc.OdbcConnection

Dim daQODBC As System.Data.Odbc.OdbcDataAdapter

Dim dsQODBC As System.Data.DataSet

cnQODBC = New System.Data.Odbc.OdbcConnection("DSN=WMS Data")

cnQODBC.Open()

daQODBC = New System.Data.Odbc.OdbcDataAdapter("SELECT ListID, FullName, CompanyName FROM Customer", cnQODBC)

dsQODBC = New System.Data.DataSet

daQODBC.Fill(dsQODBC)

dgDataGrid.DataSource = dsQODBC

 

I receive the following Error:

System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)

at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle)

at System.Data.Odbc.OdbcConnectionOpen..ctor(OdbcConnection outerConnection, OdbcConnectionString connectionOptions)

at System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)

at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)

at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)

at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)

at System.Data.Odbc.OdbcConnection.Open()

at EarthLite_QBooks.frmQBooks.LoadCust() in Z:\Earthlite Work\Project\EarthLite-QBooks\EarthLite-QBooks\Form1.vb:line 15

 

 

 

 

 

 

 

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-11-10 17:17:39
Is the Data Source Name "DSN=WMS Data" a system DSN on the local workstation you are using? Can you connect to WMS Data using VB Demo? 

  Top 
  Moliver 
  
 Group: Members 
 Posts: 7 
 Joined: 2006-11-10 
 Profile
 Posted : 2006-11-11 12:41:13
It is a User DSN and yes it works with VB Demo. 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-11-11 18:17:18
WMS Data needs to be a System DSN 

  Top 
  Moliver 
  
 Group: Members 
 Posts: 7 
 Joined: 2006-11-10 
 Profile
 Posted : 2006-11-12 15:02:39
Then how do I make it a System DSN  when QuickBooks made it a User DSN and with in the ODBC manager of XP it will only make System DSN for SQL Sever databases.  

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-11-13 09:41:32

See: How do I create or configure a QODBC DSN? 

Note: You will need to be logged in as a Admin type account in Windows XP.

 

  Top 
  Moliver 
  
 Group: Members 
 Posts: 7 
 Joined: 2006-11-10 
 Profile
 Posted : 2006-11-13 10:54:04

The Quick Books Driver does not show up as one that I may add.  I have unistalled the qodbc.exe and have reinstalled and this still does not correct the issue.  I'm logged in as the Admin.  It appears that the driver for QuickBooks is not a recognized driver to be added as a system DSN, I only have it available as an User DSN.  Thanks for your help.

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-11-13 11:05:24

The "Select a driver" screen is the same for User, File or System DSNs. Check the Driver tab.

 

  Top 
  Moliver 
  
 Group: Members 
 Posts: 7 
 Joined: 2006-11-10 
 Profile
 Posted : 2006-11-13 15:31:57

I now have created a System DSN called (WMSConn) and I still get the same results.  It works with the VB Demo if I use the create new connection by selecting the DSN, but if I use the connection String ("Provider=MSDASQL.1;Persist Security Info=False;Data Source=WMSConn;OLE DB Services=-2;") it fails.  What is accurring with in the VB Demo that makes it work but not from my simple connection code in VB.NET?  

Dim cnQODBC As System.Data.Odbc.OdbcConnection

Dim daQODBC As System.Data.Odbc.OdbcDataAdapter

Dim dsQODBC As System.Data.DataSet

cnQODBC = New System.Data.Odbc.OdbcConnection(""Provider=MSDASQL.1;Persist Security Info=False;Data Source=WMSConn;OLE DB Services=-2;")

cnQODBC.Open()

daQODBC = New System.Data.Odbc.OdbcDataAdapter("SELECT ListID, FullName, CompanyName FROM Customer", cnQODBC)

dsQODBC = New System.Data.DataSet

daQODBC.Fill(dsQODBC)

dgDataGrid.DataSource = dsQODBC

I receive the following Error:

System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)

at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle)

at System.Data.Odbc.OdbcConnectionOpen..ctor(OdbcConnection outerConnection, OdbcConnectionString connectionOptions)

at System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)

at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)

at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)

at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)

at System.Data.Odbc.OdbcConnection.Open()

at EarthLite_QBooks.frmQBooks.LoadCust() in Z:\Earthlite Work\Project\EarthLite-QBooks\EarthLite-QBooks\Form1.vb:line 15

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-11-13 15:54:58
Now you have a System DSN, try using the original example shown at: Do you have any sample code for VB.NET? with the DSN as "DSN=WMSConn" 

  Top 
  Moliver 
  
 Group: Members 
 Posts: 7 
 Joined: 2006-11-10 
 Profile
 Posted : 2006-11-14 11:45:10
I have and it fails the same way as the orginal one. 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-11-14 11:51:55
The error is saying that the "Data Source Name" isn't found, normally this only happens to Terminal or Citrix users. 

  Top 
  Moliver 
  
 Group: Members 
 Posts: 7 
 Joined: 2006-11-10 
 Profile
 Posted : 2006-11-14 12:32:45

I'm not using neither one.  Just trying to setup a connection on my local computer that has QuickBooks 7.0 (trial version) installed on.  Can you show the example connection string that the VB Demo uses since the DSN works fine there with no problem?   

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-11-14 13:58:40
Sure, see: How do I build a connection string with all the available QODBC parameters?  

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to