CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 1999
    Posts
    2

    Trouble Opening a Recordset

    I'm trying to open a recordset in a database but I keep getting and Error 13, Type Mismatch and I can't seem to figure out what I'm doing wrong. I've checked to ensure that the DAO 3.5 Library is checked in the Reference section. I'm working with VB5 and Win95. Here's my Code

    Dim SQLStatement as string
    SQLStatement = "800000_PartNumbers"
    set Ws = DBEngine.Workspaces(0)
    set OldDb = Ws.OpenDatabase("C:\Databases\msds_database.mdb")
    set RcSet = OldDb.OpenRecordset(SQLStatement, dbOpenDynaset)






  2. #2
    Join Date
    Aug 1999
    Location
    India-Delhi
    Posts
    106

    Re: Trouble Opening a Recordset

    Hi,
    I am sure you have set OLDdb as database.
    It seems that 800000_PartNumbers is name of the table in the database.
    Please modify your sqlstatement to
    SQLStatement = "Select * from 800000_PartNumbers"
    Or simply forget SQLStatement and type
    set RcSet = OldDb.OpenRecordset("800000_PartNumbers", dbOpenDynaset)

    I also assume that you have declared RcSet as Recordset.

    Goodluck




    Santulan

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

Featured