>Help I am confused. I have read that OLEDB is supposed to be faster than ODBC so decided to try my hand at it.
>
>My code is:
>cStr = [Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=
;Data Source=]
>ox=SQLSTRINGCONNECT(cstr)
>
>But every time I try this a window pops up "Select Data Source" and asks me to define a data source with the File Data Source and Machine Data Source Tabs.
>
>In ODBC I used this:
>
>cSql=[Driver={Sql Server};Server=;Database=;Int Security;]
>oConn=SQLStringConnect(cSql)
>
>This worked every time without popping up any window.
>
>Am I doing something wrong here or is OLEDB to be used only with ADO? Do I have to create this DataSource on every client that connects using OLEDB?
>
>Could someone please enlighten me as to how I can use OLEDB instead of ODBC while NOT using ADO, to get a connection to a SQL Server 2000 database?
>
>TIA
>
>Bernard
Bernard,
You're mixing OLEDB and ODBC.
OLEDB is to be used with ADO and ADO.NET.
SPT and RV in VFP use ODBC not OLEDB.
It's a misconception IMHO that OLEDB is faster than ODBC. There is no solid proof of that I know. Depending on what you're doing one might be faster than the other.
Neither with OLEDB nor ODBC you need to create a datasource on every client. There is connection string for both which you could use. ie:
lnHandle = SQLStringConnect("Driver=SQL server;"+;
"Server=servername;Integrated Security=SSPI")
SQLExec(m.lnHandle,cStatement[,cCursorName])
oConnection = CreateObject("ADODB.Connection")
with oConnection
.ConnectString = "Provider=SQL server;"+;
"Server=ServerName;Integrated Security=SSPI"
.Open
oRecordset = .Execute( cStatement )
endwith
CursorAdapters can use both and more :)
Cetin