March 28, 2008 at 12:25 am
I am writing an application using vb6 and sql server 2005. I want to know whether I should use Microsoft OLE DB Provider for SQL SERVER or SQL Native Client, to connect to databse.
e.g.
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=test1;Data Source= COMP1"
OR
cn.connectionstring = '"Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=test1;Data Source=COMP1"
I have added an adodc object on my vb6 form and built the connection from that. From there I obtained above connection strings.
Thanks.
March 28, 2008 at 3:33 am
Hi,
SQLOLEDB is the best way to go.
On the MSDN website http://msdn2.microsoft.com/en-us/library/ms130978.aspx Microsoft states the following:
"If you are developing a new application it is recommended that you consider using ADO.NET and the .NET Framework Data Provider for SQL Server instead of SQL Native Client to access all the new features of SQL Server 2005. For more information about .NET Framework Data Provider for SQL Server, please see the .NET Framework SDK documentation for ADO.NET."
and
"Existing ADO applications can access and update XML, UDT, and large value text and binary field values using the SQLOLEDB provider. The new larger varchar(max), nvarchar(max), and varbinary(max) data types are returned as the ADO types adLongVarChar, adLongVarWChar and adLongVarBinary respectively. XML columns are returned as adLongVarChar, and UDT columns are returned as adVarBinary. However, if you use the SQL Native Client OLE DB provider (SQLNCLI) instead of SQLOLEDB, you need to make sure to set the DataTypeCompatibility keyword to "80" so that the new data types will map correctly to the ADO data types."
March 28, 2008 at 3:46 am
Hi again,
On this website http://msdn2.microsoft.com/en-us/library/ms130828.aspx is a better explanation on what to use (and when to use it).
March 28, 2008 at 11:32 pm
Thanks a lot.
I will check the website addresses given by you.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply