Avatar of ygnd
ygndFlag for Israel

asked on 

excel 2003 vba to sql server 2005 express

hello to the expert,
I'm trying to connect to sql server 2005 express with excel 2003 vba using this connection
strConn = "PROVIDER=SQLOLEDB;"
strConn = strConn & "DATA SOURCE=(local);" ' the sever on my LepTop
strConn = strConn & "Initial Catalog=test;" ' my database
strConn = strConn & "Trusted_Connection=Yes;"
Dim cnPubs As ADODB.Connection
Set cnPubs = New ADODB.Connection
cnPubs.Open strConn
geting error
[DBNETLIB][connectionOpen(connect().)]sql server not exist
please advice.
Thank you,
Yalon
 
Swift ProgrammingMicrosoft ExcelMicrosoft SQL Server 2005

Avatar of undefined
Last Comment
ygnd
ASKER CERTIFIED SOLUTION
Avatar of ozi_lion
ozi_lion
Flag of Türkiye image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of ygnd
ygnd
Flag of Israel image

ASKER

Ozi, thank you.
It work fine.
Yalon
Avatar of ygnd
ygnd
Flag of Israel image

ASKER

Ozi, other question,
The connection above was related to DB and tables that I build manually with the SQL Server Management Studio Express. It works.
When i added new DB and populate it with my tables from access, using ODBC. it not work.
I get an error "invalid object name 'dbo.Items' (my table from access).
Please advice.
Thank you,
Yalon
Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

144K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo