Results 1 to 2 of 2

Thread: OleDb FoxPro Problems!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Location
    Left past the postbox
    Posts
    30

    OleDb FoxPro Problems!

    Hi,

    I was using the code below to pull up records from an access database which worked fine, but I now want to do the same to a foxpro 7 database.

    It connects to the foxpro dbase but after stepping through the code I found it crashes at

    "dgPrevious.DataSource = cmdSelect.ExecuteReader"

    the error is "Object reference not set to an instance of an object."

    PHP Code:

    Dim con 
    As OleDb.OleDbConnection
        Dim cmdSelect 
    As OleDb.OleDbCommand


       Call OpenConnection
    () ' Own procedure

       sqlquery = "SELECT Datereq, NetLogin, Title, Status, RequestId   FROM " & tbname

                cmdSelect = New OleDb.OleDbCommand(sqlquery, con)


             dgPrevious.DataSource = cmdSelect.ExecuteReader


                dgPrevious.DataBind() 
    Thanks

    Chris

  2. #2
    Addicted Member
    Join Date
    Jan 1999
    Posts
    165
    By experience I find that if there is a problem with db connection it fails after code for connection but when you apply it.
    Can you post the code for Call OpenConnection() ?
    I suspect there is a problem here (perhaps).

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