Error '3075' 
Author Message
 Error '3075'

I have a VB project with a single form and only the folowing code on the load of
the form, All I whant is to retreive all the records in a dBase III file where
the date is the 3 January 2001, but I am getting the folowing error "Malformed
GUID in query expression '(MONTRAN.PDATE={^2001-01-03})'."
I added the Microsoft ADO 2.5/3.51 reference. Can you please help me ?

Private Sub Form_Load()

    Dim sql As String
    Dim Datab As Database
    Dim recset As Recordset

    Set Datab = OpenDatabase(App.Path, True, False, "dBASE III")

    sql = "SELECT MONTRAN.PDATE FROM MONTRAN.DBF MONTRAN WHERE (MONTRAN.PDATE=
{^2001-01-03});"
    Set recset = Datab.OpenRecordset(sql)

    recset.MoveLast
    'RecSet.MoveFirst
    a = recset.RecordCount
    b = recset.Fields(0)

  montran.dbf
7K Download


Sat, 22 Nov 2003 21:35:15 GMT  
 Error '3075'
Not sure about dBase III, but in ADO I would normally do:

MONTRAN.PDATE=#2001/01/03#

I presume it is interpreting the {...} as a guid.

Quote:

>  I have a VB project with a single form and only the folowing code on the load of
>  the form, All I whant is to retreive all the records in a dBase III file where
>  the date is the 3 January 2001, but I am getting the folowing error "Malformed
>  GUID in query expression '(MONTRAN.PDATE={^2001-01-03})'."
>  I added the Microsoft ADO 2.5/3.51 reference. Can you please help me ?

>  Private Sub Form_Load()

>      Dim sql As String
>      Dim Datab As Database
>      Dim recset As Recordset

>      Set Datab = OpenDatabase(App.Path, True, False, "dBASE III")

>      sql = "SELECT MONTRAN.PDATE FROM MONTRAN.DBF MONTRAN WHERE (MONTRAN.PDATE=
>  {^2001-01-03});"
>      Set recset = Datab.OpenRecordset(sql)

>      recset.MoveLast
>      'RecSet.MoveFirst
>      a = recset.RecordCount
>      b = recset.Fields(0)

Robert Chafer
Silverfrost Limited.   http://www.silverfrost.com
Home to Solar Kingdom, the 3D Solar System Simulator


Sun, 23 Nov 2003 06:54:37 GMT  
 Error '3075'

Quote:
> MONTRAN.PDATE=#2001/01/03#

This might be an Access-SQL thing.  If this doesn't work, try
single quotes.  Also, some DBMS are finicky about the format
of the date--you'll have to check that system's manual.


Sun, 23 Nov 2003 10:09:11 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Command object Run time error '3075'

2. Run-time error '3075': Access 97 and VB 5.0

3. Error '3075'

4. Error 3075: function isn't available in expressions in query expression

5. '|' in sql query gives - Error 3075 - 'Invalid use of vertical bars...'

6. '|' in sql query gives - Error 3075 - 'Invalid use of vertical bars...'

7. Help on Error 3075(Systax Error)

8. Error 3075 Syntax error in date where no date is involved

9. Rnutime error 3075 ....Help Please

10. runtime error 3075

11. This crazy run time error 3075

12. Need help to work Error 3075

 

 
Powered by phpBB® Forum Software