Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 367
Default Changing data access from MSAccess2000 to SQL Server

I am currently writing a program in Excel that will take data off of a SQL
server and dump it into an excel spreadsheet so that i can crunch numbers and
display the information. I used an access database with dummy information to
work on crunching the numbers because the serverwas not set up yet, but now i
want to grab the data off of the database we set up on the server instead of
the access file. i used a JET object to grab the data from the access file,
but i am having quite a hard time getting the data off of the server. this
is the code i used for the Access:

Set myConn = New ADODB.Connection
Set myRec = New ADODB.Recordset
myConn.Provider = "Microsoft.jet.oledb.4.0"
myConn.Open "\\yodisk2\shryork\tober\glassing1.mdb"

This is the code I am attempting to use for the SQL:

myConn.Provider = "SQLOLEDB.1"
myConn.ConnectionString= "DATABASE=glassPLC1;SERVER=yosql1;"

I am not sure why this is not working. Any advice would be greatly
appreciated. Thank you.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default Changing data access from MSAccess2000 to SQL Server


Jason wrote:
I am currently writing a program in Excel that will take data off of

a SQL
server and dump it into an excel spreadsheet so that i can crunch

numbers and
display the information. I used an access database with dummy

information to
work on crunching the numbers because the serverwas not set up yet,

but now i
want to grab the data off of the database we set up on the server

instead of
the access file. i used a JET object to grab the data from the

access file,
but i am having quite a hard time getting the data off of the server.

this
is the code i used for the Access:

Set myConn = New ADODB.Connection
Set myRec = New ADODB.Recordset
myConn.Provider = "Microsoft.jet.oledb.4.0"
myConn.Open "\\yodisk2\shryork\tober\glassing1.mdb"

This is the code I am attempting to use for the SQL:

myConn.Provider = "SQLOLEDB.1"
myConn.ConnectionString= "DATABASE=glassPLC1;SERVER=yosql1;"

I am not sure why this is not working. Any advice would be greatly
appreciated. Thank you.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default Changing data access from MSAccess2000 to SQL Server


Jason wrote:

This is the code I am attempting to use for the SQL:

myConn.Provider = "SQLOLEDB.1"
myConn.ConnectionString= "DATABASE=glassPLC1;SERVER=yosql1;"


Try changing DATABASE to INITIAL CATALOG.

Jamie.

--

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Access Thru News Server trip_to_tokyo[_3_] Excel Discussion (Misc queries) 3 January 13th 10 09:16 PM
Connect to Access Database On Remote Server UT Excel Discussion (Misc queries) 0 August 21st 07 10:42 PM
Export from Access/SQL Server JIM Excel Discussion (Misc queries) 0 August 20th 06 08:09 PM
How do I access data stored in a SQL server for vlookup function? M.Heer Excel Worksheet Functions 8 May 12th 05 09:51 PM
ado connection to access vs. sql server? Loane Sharp Excel Programming 7 November 16th 04 05:08 PM


All times are GMT +1. The time now is 10:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"