can't access dbase III external database 
Author Message
 can't access dbase III external database

I've just about exhausted all my resources in trying to find out why
my program won't work.  I'm trying to read a DBASE 3 dbf file that's
on the server.  I can read it using a simple data control, but when I
try to set up an SQL query so it orders everything correctly, it
totally screws up....it tells me the "method" doesn't exist for a
recordset object...that makes no sense at all because the method I'm
using (Refresh) is listed in the Online books as a method the
Recordset object should have, and yet Visual Basic 4.0 still tells me
it can't find that method.....

here is my code:

Dim MyQuery As String
Dim dataOld As Recordset
Dim Query As QueryDef
Dim dataInvoice As Recordset
Dim dbsjet As Database

lblChoose.Visible = False
MyQuery$ = "SELECT
'This is the SQL statement I want to send it..but if I leave this in,
when I go to refresh, it just says"Invalid name" and highlights this
SQL statement...what's invalid about this SQL statemenet??"
    MyQuery$="SELECT
PARTNO,CUSTNAME,INVOICENO,CUSTPONO,INVDATE,QTYSHIP,SHIPVIA" _

            & " FROM dataINVOICE " _
            & " IN '\\netserver_nt\daily\invoice.dbf' 'dBASE III;'" _
            & " ORDER BY CUSTPONO,INVDATE;"

'dataInvoice.RecordSource = MyQuery
Set dbsjet = OpenDatabase _
            ("\\netserver_nt\daily\", False, True, "dBASE III;")

Set dataInvoice = dbsjet.OpenRecordset("Invoice")
dataInvoice.Refresh

It gives me the error "Method, or data member not found" for the
dataInvoice.Refresh line



Tue, 24 Nov 1998 03:00:00 GMT  
 can't access dbase III external database

Quote:

>I've just about exhausted all my resources in trying to find out why
>my program won't work.  I'm trying to read a DBASE 3 dbf file that's
>on the server.  I can read it using a simple data control, but when I
>try to set up an SQL query so it orders everything correctly, it
>totally screws up....it tells me the "method" doesn't exist for a
>recordset object...that makes no sense at all because the method I'm
>using (Refresh) is listed in the Online books as a method the
>Recordset object should have, and yet Visual Basic 4.0 still tells me
>it can't find that method.....
>here is my code:
>Dim MyQuery As String
>Dim dataOld As Recordset
>Dim Query As QueryDef
>Dim dataInvoice As Recordset
>Dim dbsjet As Database
>lblChoose.Visible = False
>MyQuery$ = "SELECT
>'This is the SQL statement I want to send it..but if I leave this in,
>when I go to refresh, it just says"Invalid name" and highlights this
>SQL statement...what's invalid about this SQL statemenet??"
>    MyQuery$="SELECT
>PARTNO,CUSTNAME,INVOICENO,CUSTPONO,INVDATE,QTYSHIP,SHIPVIA" _
>            & " FROM dataINVOICE " _
>            & " IN '\\netserver_nt\daily\invoice.dbf' 'dBASE III;'" _
>            & " ORDER BY CUSTPONO,INVDATE;"

>'dataInvoice.RecordSource = MyQuery
>Set dbsjet = OpenDatabase _
>            ("\\netserver_nt\daily\", False, True, "dBASE III;")

>Set dataInvoice = dbsjet.OpenRecordset("Invoice")
>dataInvoice.Refresh
>It gives me the error "Method, or data member not found" for the
>dataInvoice.Refresh line

Nice to see someone who has enough sense to include a code
snippet!

Forget the data control for a second and try this.

1. ) set db = opendatabase(...)
2. ) set ds = db.createdynaset("Select * from mytable")
3. ) ds.refresh

You have 1 and 2 reversed.  So, there is no object for
the refresh method.

As far as the error in the SQL statement, without the table
layout, it is hard to tell.  When you start getting errors like
that it is using a misspelled field name.  Start out small and
build it up slowly.  Also, you may want to try using the
visdata example project that comes with VB.  It has a
nice little query builder that helps debugging this sort
of thing.


http://www.xnet.com/~kd9fb



Wed, 25 Nov 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Linking a dBase III table to an Access 2000 database - won't open

2. dBase III access, won't work ????

3. VB# won't access dbase III file

4. I can't read dBase III file in Visual Basic

5. Problems adding new records to ODBC source (dBASE III dbf's)

6. open dbase type dbase III

7. Creating dbase III database file

8. Create a .dbf(dbase III) database

9. vb4.0 searching dBase III database

10. Converting dBase III tables -> SQL databases

11. ISAM error using dBASE III database

12. VisualBASIC dBASE III Database reading problems

 

 
Powered by phpBB® Forum Software