Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I would appreciate any snippets of code that show an example of how t connect to a Microsoft SQL database using ADO. The examples I've see in various books don't specify the login user name, password, and als don't specify the table name. Maybe I haven't found the right ones. Most of them are geared toward MS Access database. Thanks - veritasc ----------------------------------------------------------------------- Posted via http://www.mcse.m ----------------------------------------------------------------------- View this thread: http://www.mcse.ms/message566438.htm |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
For a nice list of OLEDB connection strings see the following http://www.able-consulting.com/MDAC/...derForSQLServe Also, Dan has a nice example here http://mrexcel.com/board2/viewtopic.php?t=53716&start= Regards Nate Oliver |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here are some connection string samples, including SQL Server:
http://www.able-consulting.com/MDAC/...erForSQLServer Note you do not specify tables in the connection string; rather you execute the SQL you would normally use in Query Analyzer against the ADO connection. -- veritasca wrote in message ... Hi, I would appreciate any snippets of code that show an example of how to connect to a Microsoft SQL database using ADO. The examples I've seen in various books don't specify the login user name, password, and also don't specify the table name. Maybe I haven't found the right ones. Most of them are geared toward MS Access database. Thanks. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Nate Oliver wrote: *Hello, For a nice list of OLEDB connection strings see the following: http://tinyurl.com/80qj Also, Dan has a nice example he http://mrexcel.com/board2/viewtopic.php?t=53716&start=6 Regards, Nate Oliver * __________ Thanks, Nate. I used Dan's nice example and got to by database connection but faile when it tries to open the recordset, please see below: --------- Dim adoCN As ADODB.Connection, adoRS As ADODB.Recordset Dim strSQL As String Set adoCN = New ADODB.Connection adoCN.Open "Provider=sqloledb;" & _ "Data Source=DemoSQL;" & _ "Initial Catalog=template_template1backup2_db0;" & _ "User Id=User01;" & _ "Password=Snno4" Set adoRS = New ADODB.Recordset strSQL = "SELECT * FROM RUN" 'Open the recordset adoRS.Open strSQL, adoCN, adOpenForwardOnly, adLockReadOnly -------- It failed right at this last statement with a pop-up Error message Run-time error '-2147217865(80040e37) Automation Error How do I debug this??? Your help is appreciated. Thanks - veritasc ----------------------------------------------------------------------- Posted via http://www.mcse.m ----------------------------------------------------------------------- View this thread: http://www.mcse.ms/message566438.htm |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry to just jump in, but I'm getting this exact same error whil
trying to connect to a SQL 2000 db. Was the issue resolved? If so, how did you make it work? Thanks -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to connect excel(If I consider it as a database) with a websit | Excel Discussion (Misc queries) | |||
How to connect to database? | Excel Worksheet Functions | |||
connect to access database and run a query in excel VBA | Excel Discussion (Misc queries) | |||
connect a form to excel database | Excel Discussion (Misc queries) | |||
How to connect to Informix database using ADO??? | Excel Programming |