473,395 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Data source name not found error

17
Hi All,
i recieved error on the following connection string in the combo box change event
code as follows,

Expand|Select|Wrap|Line Numbers
  1. Private Sub LotNo_Change()
  2. Dim conn As New ADODB.Connection
  3. Dim sConnString As String
  4.  
  5.  
  6. 'Create connection string
  7. sConnString = conn.Provider = "SQLOLEDB; Data Source=SDSACCOUNT; Initial Catalog= SSPLCO; user ID=sa; Password=sa;"
  8.  
  9. 'Open connection and execute
  10. conn.Open sConnString
  11.  
  12. 'Do your query
  13. conn.Execute "Select ITEMNO FROM ICITEM;"
  14.  
  15. End Sub
Any Solution?
Thanks in advance...
Apr 1 '15 #1
1 1578
Stewart Ross
2,545 Expert Mod 2GB
You have a misformed connection string at line 7, where the provider is not part of the string (you appear to be mixing part of the connection object in with the connection string, which is not going to work at all.

Try

Expand|Select|Wrap|Line Numbers
  1. sConnString = "Provider = SQLOLEDB; Data Source=SDSACCOUNT; Initial Catalog= SSPLCO; user ID=sa; Password=sa;"
-Stewart
Apr 2 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Nick Poulis | last post by:
Hi to all I face the following problem, the following code (very simple) is contained in a referenced class method Dim cn As New OdbcConnection("DSN=BOC;UID=Admin;PWD=;") cn.Open()
4
by: smcdanie | last post by:
When trying to view an asp page on my Windows 03 server, I get the following error message: Microsoft OLE DB Provider for ODBC Drivers error '80004005' Data source name not found and no...
0
by: Luca | last post by:
Hello to all, I have a problem during connection to mysql through oledb provider. I use Microsoft Visual C++ with MFC on Windows and I try to connect to mysql with the following call: hResult =...
12
by: bhanu08 | last post by:
I am get this error java.sql.SQLException: Data source name not found and no default driver specified my code for connection is { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");...
1
by: Gourisankar | last post by:
Hi, I am using a VB6 application. While I am trying to access Sybase Database stored procedure through DSR, It is giving the error "Data source name not found or Default driver is not specified" ....
5
by: Darshini | last post by:
Hi When ever opening my asp pages im getting this error..plz give some solution Data source name not found and no default driver specified
1
by: harsha1302 | last post by:
Hi all i am trying to connect my application written in jsp to the database and i am receiving this exception java.sql.SQLException: Data source name not found and no default driver specified...
4
by: santhanalakshmi | last post by:
Hi, In ODBC, i given data source name and the test connection is also successful. But i don't know, why i am facing this error DBI connect('wwwdsn','webid',...) failed: Data...
1
by: vinothvit | last post by:
error:java.sql.SQLException: Data source name not found and no default driver specified above error is shown, i have used oracle10g as database my code:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.