Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Database Connection

Hi Phil,

If you're using ADO to connect to SQL Server, I suggest using an OLEDB
connection string. More info he

http://msdn.microsoft.com/library/de...qlprovspec.asp

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Phil wrote:
Hi,

I am currently testing different ways that I can connect my SQL Server
Database to my Excel Sheet and I just wanted to know if there are any
real
advantages to either, at first I was trying the below connection
string in VB
in my Excel Sheet -:

"ODBC;DSN=NameOfDSN;UID=UserName;pword=PASSWORDAPP =Microsoft®
Query;WSID=SERVER;DATABASE=DATABASE;Network=DBMSSO CN;Trusted_Connection=Yes"
_

Now if I have my logic right which I might not do :-) this has to
have a
ODBC connection set up through control pannel to work.

The other connection string is -:

"ODBC;Driver={SQL
Server};Server=SERVER;Database=DATABASE;WSID=WorkS tationID;UID=UserName;pword=PASSWORDAPP=Microsoft ®
Query;Network=DBMSSOCN;Trusted_Connection=Yes" _

This string sets up all the connection attributes through the VB
without
having to use Control Pannel.

Are my assumptions with both of these connections correct and if so
for some
reason I get a different output from the second string connection,
for some
reason it will return my table headings in the SQL Database but no
data, but
if it is run a couple of times it suddenly starts to work, I though I
was
slowly getting the grasp of all this but it appears not.

Any help that is offered would be much appreciated.

Regards
Philip


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
Excel connection to ODBC database Poppe Excel Discussion (Misc queries) 8 April 24th 09 06:16 AM
Database Connection from Excel Lost! Excel Programming 1 August 31st 04 02:19 AM
DataBase Connection willie[_2_] Excel Programming 0 January 27th 04 10:06 PM
help with database connection - urgent joao Excel Programming 5 November 12th 03 03:05 PM
Does destroying the ADO Connection close the database? Bob Phillips[_5_] Excel Programming 0 July 18th 03 08:04 PM


All times are GMT +1. The time now is 10:16 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"