SELECT COUNT(*) INTO '" & strCounter & "'

BartekSollie

New member
Local time
Today, 19:42
Joined
May 1, 2006
Messages
4
Could someone solve this problem for me. I want to insert a SQL result into a declared string variabele. In Oracle it is posible and i dont have find it out yet with vba. In Oracle the statement is like this

** sample code
DECLARE strNumber NUMBER;

INSERT COUNT(*) INTO :strNumber WHERE etc.
**

Is this same statement in VBA posible with something like this?

DIM strCounter AS Long

SELECT COUNT(*) INTO '" & strCounter & "'
 
In VBA, you can use the DCount() function.

Dim lCounter As Long

lCounter = DCount("*", "TableName or QueryName")

^
 

Users who are viewing this thread

Back
Top Bottom