LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default DSN-Less Connections

Hi All,

Having a spot of difficulty doing a DSN-Less connection would anyone b
able to see what is wrong with the following code please? It keep
coming back with;

"datasource name not found and no default driver specified"

when I try opening the connection;

ecpsrvConnection.Open ecpsrvConnect

I've tried http://www.able-consulting.com/ADO_Conn.htm and variou
other sites with example connection strings. Nothing works...

Thanks All, as always very much appreciated!

Sau

*-*-*-*

Function ecpsrvDBCons()

Dim ecpsrvLogin As String
Dim ecpsrvPassword As String
Dim ecpsrvname As String
Dim ecpsrvConnect As String
Dim ecpsrvConnection As ADODB.Connection

ecpsrvLogin = "sa"
ecpsrvPassword = vbNullString
ecpsrvname = "ECPSRV;"

ecpsrvConnect = "ODBC;Provider={SQL Server};" & _
"Server=" & ecpsrvname & ";" _
& "Database=Concorde" & ";" _
& "Uid=" & ecpsrvLogin & ";" _
& "Pwd=" & ecpsrvPassword & ";"


End Function
Call ecpsrvDBCons

Dim sQuery1 As String
Dim ecpsrvRecordset As ADODB.Recordset
Dim ecpsrvCommand As ADODB.Command

Set ecpsrvConnection = New ADODB.Connection
ecpsrvConnection.Open ecpsrvConnect

Set ecpsrvCommand = New ADODB.Command
Set ecpsrvCommand.ActiveConnection = ecpsrvConnect

sQuery1 = ""
sQuery1 = sQuery1 & " SELECT COUNT * "
sQuery1 = sQuery1 & " FROM " & "tbl_patient.lastname

--
Message posted from http://www.ExcelForum.com

 
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
Data connections Julie LF Excel Discussion (Misc queries) 5 January 30th 09 10:55 PM
Data Connections Ric Lager Excel Worksheet Functions 0 December 5th 08 05:35 PM
Data connections Nat Excel Discussion (Misc queries) 0 August 7th 08 05:23 PM
remote connections John A Grandy New Users to Excel 1 May 26th 06 12:58 AM
Deleting old connections Janene[_2_] Excel Programming 0 June 9th 04 01:06 AM


All times are GMT +1. The time now is 04:27 AM.

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"