PDA

Click to See Complete Forum and Search --> : ADO - sqloledb Provider Error message


vidkrish
Jul 29th, 1999, 08:36 PM
I tried to connect to SQL Server 6.5 database
using ADO (sqloledb Provider ) in Visual Basic 6.0. I get a "Microsoft Visual C++ runtime library error Assertion failed."
Please let me know why.
Is it that ADO was developed in COM using Visual C++ or is it that ADO using Sqloledb provider can be used only with SQL Server 7.0.
Any help would be greatly appreciated by me.

Thanking you all,
Vidya.

This is the code I wrote:-

Private Sub Form_Load()
Dim rstEmployees As ADODB.Recordset
Dim strCnn As String
Dim strMessage As String
Dim intRows As Integer
Dim avarRecords As Variant
Dim intRecord As Integer
strCnn = "Provider=sqloledb;" & _
"Data Source=test;Initial Catalog=test;User Id=sa;Password=pwd; "
Set rstEmployees = New ADODB.Recordset
MsgBox (" Open the db successfully:")
rstEmployees.Open "SELECT Name" & _
"FROM test", strCnn, , , adCmdText

End Sub

Blue Ghost
Aug 1st, 1999, 11:18 AM
I think you're missing a space....

can't see your code from this screen but you don't have a space after your SELECT Name From ....

Need to be like this: ssql = "SELECT Field FROM Table" blah blah blah... can of course have more fields, more tables, list of conditions and sort options, but the important point is the space.

vidkrish
Aug 1st, 1999, 07:00 PM
Thanks a lot .

I do have a space there.