473,379 Members | 1,174 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,379 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 1576
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.