Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data connections | Excel Discussion (Misc queries) | |||
Data Connections | Excel Worksheet Functions | |||
Data connections | Excel Discussion (Misc queries) | |||
remote connections | New Users to Excel | |||
Deleting old connections | Excel Programming |