>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=<MyDatabase>;Data Source=<MyServer>]
>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.
The message is coming from the SQLSTRINGCONNECT, not OLEDB. SQLSTRINGCONNECT is for use with ODBC, not OLEDB. You can't mix the two methods.
>
>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?
OLEDB is a C level interface to the data. ADO is a COM wrapper around OLEDB to make it easy to use from VFP, VB, etc.
>
>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?
As I said, you can't. You have to use either OLEDB/ADO or ODBC.
>
>TIA
>
>Bernard
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer