Executing SQL queries using modules via Jet 
Author Message
 Executing SQL queries using modules via Jet

Hiya,

Is there anyway that I can possibly run a SQL command from my Jet 4.0
connection (VB.net) which uses a custom written module? The below code and
subsequent SQL query of
"select getDay(transactionDate) from tblTransaction" runs fine when the DB
is open through Access but I can't run the same query using a Jet
connection. Any ideas? I know about the datepart function but this is just
some test code.

Function getDay(ByVal pDate As String) As Integer
    Dim arrDate() As String

    arrDate = Split(pDate, "/")
    getDate = CInt(arrDate(0))
End Function

Many thanks,
Darryn



Fri, 11 Feb 2005 10:56:48 GMT  
 Executing SQL queries using modules via Jet
Several things to check:

How you open your db and recordset connections may be the
issue.

How your variables are dimensioned may be a problem. Also,
if pDate is doing recordset operations you might therein
find your problem.

Finally, check db.state when coming back from the
function. I think you'll find a revelation.



Fri, 11 Feb 2005 13:12:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Executing SQL queries using modules via Jet

2. Using SQL to execute a Query with ANDs and ORs

3. How to execute SQL that queries multiple databases using rdo

4. Using an sql query in a class module

5. Can't save queries to new Jet DB via ADO

6. Executing Queries containing VBA function via ODBC

7. can you execute a database query Via Client side script

8. can you execute a query via Client side script

9. Executing Access action query via ADO

10. Need to Send Query Criteria via a Module

11. : Sending Binary 0 Within a String to Jet Via SQL

12. Datetime: how to insert via jet SQL

 

 
Powered by phpBB® Forum Software