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