ygnd
asked on
excel vba connect to sql server 2005 express
Hello to the team again.
When I'm Using excel VBA to load sql server 2005 express data from tables that populate manually, with Management Studio Express. It works fine.
When I added new DB and populate it with my tables from access, using ODBC. it's not work.
I 'm getting an error "invalid object name 'dbo.Items' (my table from access).
Please advice.
Thank you,
Yalon
When I'm Using excel VBA to load sql server 2005 express data from tables that populate manually, with Management Studio Express. It works fine.
When I added new DB and populate it with my tables from access, using ODBC. it's not work.
I 'm getting an error "invalid object name 'dbo.Items' (my table from access).
Please advice.
Thank you,
Yalon
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm using dbo.Items
ASKER
Done.
It ok.
I hade Miss write of the table name.
Thank you
Yalon
It ok.
I hade Miss write of the table name.
Thank you
Yalon
ok great,
so you manage to grab data from access with the above connection string?
cheers
cslarsen
so you manage to grab data from access with the above connection string?
cheers
cslarsen
ASKER
I have an Excel application that using date from access which I'm now converting to sql server 2005 express.
With your help, it is already runing from the sql.
But I still have some more question comming ahead.
I exported tables from access to sql, using export method in the access through ODBC connection.
I found your service, very effective.
Thank you.
Yalon
With your help, it is already runing from the sql.
But I still have some more question comming ahead.
I exported tables from access to sql, using export method in the access through ODBC connection.
I found your service, very effective.
Thank you.
Yalon
ASKER
strConn = "PROVIDER=SQLOLEDB;"
strConn = strConn & "DATA SOURCE=LepTop-2\SQLExPRESS
strConn = strConn & "Initial Catalog=WizPlan.V6;"
strConn = strConn & "Trusted_Connection=Yes;"
Dim DBcn As ADODB.Connection
Set DBcn = New ADODB.Connection
DBcn.Open strConn
sSQL = ""
sSQL = sSQL & "SELECT * FROM bdo.Items;"
Dim rst As ADODB.Recordset
Set rst = DBcn.Execute(sSQL)