Count Queries in a Database

G

Guest

I need an example of how to count the number of Queries that I have in a
Database.

I am using the code below; Where MSysObjects.Type = 5 (Represents QueryDefs).

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim CmdExec As String

Set db = CurrentDb

Set rst = db.OpenRecordset("Select MSysObjects.Name From MSysObjects
Where (((MSysObjects.Type)=5) And (InStr([NAme],""~"")=False);")

The syntax is incorrect, but I cannot figure out what the machine wants.

Also should I be useing QueryDefs in my code some place?

Help Will be Appreciated!

Len
 
G

Guest

Stupid of Me!, I looked at it for three hours!

Thanks!

SteveS said:
Hi Len,

There should be 2 closing parentheses after "False".

Should look like

<snip>....InStr([NAme],""~"")=False));")

^^

Also should I be useing QueryDefs in my code some place?

You could....it depends on what you want to do....

HTH
--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


Len said:
I need an example of how to count the number of Queries that I have in a
Database.

I am using the code below; Where MSysObjects.Type = 5 (Represents QueryDefs).

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim CmdExec As String

Set db = CurrentDb

Set rst = db.OpenRecordset("Select MSysObjects.Name From MSysObjects
Where (((MSysObjects.Type)=5) And (InStr([NAme],""~"")=False);")

The syntax is incorrect, but I cannot figure out what the machine wants.

Also should I be useing QueryDefs in my code some place?

Help Will be Appreciated!

Len
 
G

Guest

...... sometimes you can't see the trees for the forest... :)

Glad I was able to help
--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


Len said:
Stupid of Me!, I looked at it for three hours!

Thanks!

SteveS said:
Hi Len,

There should be 2 closing parentheses after "False".

Should look like

<snip>....InStr([NAme],""~"")=False));")

^^

Also should I be useing QueryDefs in my code some place?

You could....it depends on what you want to do....

HTH
--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


Len said:
I need an example of how to count the number of Queries that I have in a
Database.

I am using the code below; Where MSysObjects.Type = 5 (Represents QueryDefs).

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim CmdExec As String

Set db = CurrentDb

Set rst = db.OpenRecordset("Select MSysObjects.Name From MSysObjects
Where (((MSysObjects.Type)=5) And (InStr([NAme],""~"")=False);")

The syntax is incorrect, but I cannot figure out what the machine wants.

Also should I be useing QueryDefs in my code some place?

Help Will be Appreciated!

Len
 
G

Guest

Hi Len,

There should be 2 closing parentheses after "False".

Should look like

<snip>....InStr([NAme],""~"")=False));")

^^

Also should I be useing QueryDefs in my code some place?

You could....it depends on what you want to do....

HTH
--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


Len said:
I need an example of how to count the number of Queries that I have in a
Database.

I am using the code below; Where MSysObjects.Type = 5 (Represents QueryDefs).

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim CmdExec As String

Set db = CurrentDb

Set rst = db.OpenRecordset("Select MSysObjects.Name From MSysObjects
Where (((MSysObjects.Type)=5) And (InStr([NAme],""~"")=False);")

The syntax is incorrect, but I cannot figure out what the machine wants.

Also should I be useing QueryDefs in my code some place?

Help Will be Appreciated!

Len
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top