Results 1 to 3 of 3

Thread: ADO - sqloledb Provider Error message

  1. #1

    Thread Starter
    New Member
    Join Date
    May 1999
    Posts
    11

    Post

    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


  2. #2
    New Member
    Join Date
    Jul 1999
    Posts
    5

    Post

    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.

  3. #3

    Thread Starter
    New Member
    Join Date
    May 1999
    Posts
    11

    Post

    Thanks a lot .

    I do have a space there.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width