Any Recordset stays empty when using SQL Native Client
- From: "Predius" <Predius@xxxxxxxxxxxxxx>
- Date: Thu, 9 Nov 2006 10:40:15 +0100
Hello,
I am trying to switch a VB6 application from SQLOLEDB to SQLNCLI (SQL Native
Client) in order to use the new features of SLQ Server 2005. An
ADODB.Connection seems to work so far, but as soon as I try to retrieve any
data my Recordsets stay emtpy although the queries arrive correctly at the
Server and *should* return data (veryfied with SQL Profiler).
'Example code:
Dim con As New ADODB.Connection
Dim recordset1 As New ADODB.Recordset
Dim recordset2 As New ADODB.Recordset
Dim recordsaffected As Integer
con.ConnectionString = "Provider=SQLNCLI.;" _
& "Server=someserver;" _
& "Database=somedb;" _
& "Integrated Security=SSPI;" _
& "DataTypeCompatibility=80;" _
& "MARS Connection=True;"
con.Open
Set recordset1 = con.Execute("SELECT * FROM sometable", recordsaffected,
adCmdText)
Set recordset2 = con.Execute("SELECT * FROM sometable2",
recordsaffected, adCmdText)
con.Close
Set con = Nothing
'End of example
Has anybody got a clue for me, I'm rather stumped. According to MS this code
segment should work with ADO.
My ADO Version referenced by VB6 is 2.81.1117.0 whis is the actual Version
of XP (xpsp_sp2_rtm.040803-2158).
I have the odd feeling that my Connectionstring is missing something
essential.
.
- Follow-Ups:
- Prev by Date: Re: Password Protecting ASP Pages
- Next by Date: Re: Any Recordset stays empty when using SQL Native Client
- Previous by thread: Password Protecting ASP Pages
- Next by thread: Re: Any Recordset stays empty when using SQL Native Client
- Index(es):
Loading