haribabu
Aug 5th, 2005, 03:55 AM
Hi Friends,
I am working on Project Using VB 6.0 & MS Access 2000..
I am using ADO for Database connection...
Problem is while Executing the below qry, I am getting error...
Qury Name: qry_GenerateInvoice
In Access:-
"SELECT IIf(IsNull(Max([Sales]![InvoiceNo])),fnFormatDate(Date()),Max([Sales]![InvoiceNo]))+1 AS Expr1 FROM Sales WHERE (((Sales.InvoiceNo)>fnFormatDate(Date())));"
In query, fnFormatDate is Function written in Access Module...
While executing the query from VB, I am getting error Invalid SQL Statement expecting INSERT, UPDDATE OR SELECT STATEMENT.... While I further working on this, I am getting error - UNDEFINED FUNCTION 'fnFormatDate'EXPRESSION
How to solve this problem?
Mainly I need solution that whether I call functions of Access Module using Select Statement from VB 6.0
FYI: This Query work fine in Access
Thanxs in advance..
I am working on Project Using VB 6.0 & MS Access 2000..
I am using ADO for Database connection...
Problem is while Executing the below qry, I am getting error...
Qury Name: qry_GenerateInvoice
In Access:-
"SELECT IIf(IsNull(Max([Sales]![InvoiceNo])),fnFormatDate(Date()),Max([Sales]![InvoiceNo]))+1 AS Expr1 FROM Sales WHERE (((Sales.InvoiceNo)>fnFormatDate(Date())));"
In query, fnFormatDate is Function written in Access Module...
While executing the query from VB, I am getting error Invalid SQL Statement expecting INSERT, UPDDATE OR SELECT STATEMENT.... While I further working on this, I am getting error - UNDEFINED FUNCTION 'fnFormatDate'EXPRESSION
How to solve this problem?
Mainly I need solution that whether I call functions of Access Module using Select Statement from VB 6.0
FYI: This Query work fine in Access
Thanxs in advance..