** URGENT ** CreateQueryDef

B

Badger04

Hi All

When I'm trying to run an Access application I'm getting an error message :

Object variable or With block variable not set

Bit it's falling over is ;

'And run the query to produce a recordset
Set qdf = db.CreateQueryDef("")
With qdf
.SQL = strSQL
Set rec = .OpenRecordset()
End With

Your help would be very much appreciated

Badger
 
B

Badger04

Thanks Ken for your attention,
I am thinking it could be referrencing issue as users are running the
production version fine, as my machine is a developer build (with VB, MDAC
2.6 etc) , unless your knowledge can point me in the right direction.

TIA Badger

Code immediately prior to Set qdf is ;

'Opens external password Protected db to provide details of password for user
Dim oAcc As Access.Application

Const TMP = "E:\UQCSecurity.mdb"

Set oAcc = New Access.Application
Set db = oAcc.DBEngine.OpenDatabase(TMP, False, False, ";PWD=Picard359")
oAcc.OpenCurrentDatabase TMP

'Build Query to Select Password for Checking

strSQL = "select Password, UserProfile, DateReview, [Checker No] from
tblPasswords where NTLogon " & _
" = """ & strUserId & """ and Password = """ & strPWD & """"
 
K

Ken Snell [MVP]

On which exact line do you get the "object not set" error?

--

Ken Snell
<MS ACCESS MVP>

Badger04 said:
Thanks Ken for your attention,
I am thinking it could be referrencing issue as users are running the
production version fine, as my machine is a developer build (with VB, MDAC
2.6 etc) , unless your knowledge can point me in the right direction.

TIA Badger

Code immediately prior to Set qdf is ;

'Opens external password Protected db to provide details of password for
user
Dim oAcc As Access.Application

Const TMP = "E:\UQCSecurity.mdb"

Set oAcc = New Access.Application
Set db = oAcc.DBEngine.OpenDatabase(TMP, False, False, ";PWD=Picard359")
oAcc.OpenCurrentDatabase TMP

'Build Query to Select Password for Checking

strSQL = "select Password, UserProfile, DateReview, [Checker No] from
tblPasswords where NTLogon " & _
" = """ & strUserId & """ and Password = """ & strPWD & """"

Ken Snell said:
What is the code step where you set db to CurrentDb?
 
B

Badger04

Hi Ken

error occurs :

Set qdf = db.CreateQueryDef("")

I have just ran the db on a box that hasn't got VB installed and it works
fine, Am I following a red herring with this line of investigation?

Many thanks


Ken Snell said:
On which exact line do you get the "object not set" error?

--

Ken Snell
<MS ACCESS MVP>

Badger04 said:
Thanks Ken for your attention,
I am thinking it could be referrencing issue as users are running the
production version fine, as my machine is a developer build (with VB, MDAC
2.6 etc) , unless your knowledge can point me in the right direction.

TIA Badger

Code immediately prior to Set qdf is ;

'Opens external password Protected db to provide details of password for
user
Dim oAcc As Access.Application

Const TMP = "E:\UQCSecurity.mdb"

Set oAcc = New Access.Application
Set db = oAcc.DBEngine.OpenDatabase(TMP, False, False, ";PWD=Picard359")
oAcc.OpenCurrentDatabase TMP

'Build Query to Select Password for Checking

strSQL = "select Password, UserProfile, DateReview, [Checker No] from
tblPasswords where NTLogon " & _
" = """ & strUserId & """ and Password = """ & strPWD & """"

Ken Snell said:
What is the code step where you set db to CurrentDb?

--

Ken Snell
<MS ACCESS MVP>

Hi All

When I'm trying to run an Access application I'm getting an error
message
:

Object variable or With block variable not set

Bit it's falling over is ;

'And run the query to produce a recordset
Set qdf = db.CreateQueryDef("")
With qdf
.SQL = strSQL
Set rec = .OpenRecordset()
End With

Your help would be very much appreciated

Badger
 
K

Ken Snell [MVP]

Does the PC that isn't working have full read/write/delete/create rights to
the folder where the database UQCSecurity.mdb is located?

--

Ken Snell
<MS ACCESS MVP>

Badger04 said:
Hi Ken

error occurs :

Set qdf = db.CreateQueryDef("")

I have just ran the db on a box that hasn't got VB installed and it works
fine, Am I following a red herring with this line of investigation?

Many thanks


Ken Snell said:
On which exact line do you get the "object not set" error?

--

Ken Snell
<MS ACCESS MVP>

Badger04 said:
Thanks Ken for your attention,
I am thinking it could be referrencing issue as users are running the
production version fine, as my machine is a developer build (with VB,
MDAC
2.6 etc) , unless your knowledge can point me in the right direction.

TIA Badger

Code immediately prior to Set qdf is ;

'Opens external password Protected db to provide details of password
for
user
Dim oAcc As Access.Application

Const TMP = "E:\UQCSecurity.mdb"

Set oAcc = New Access.Application
Set db = oAcc.DBEngine.OpenDatabase(TMP, False, False,
";PWD=Picard359")
oAcc.OpenCurrentDatabase TMP

'Build Query to Select Password for Checking

strSQL = "select Password, UserProfile, DateReview, [Checker No] from
tblPasswords where NTLogon " & _
" = """ & strUserId & """ and Password = """ & strPWD & """"

:

What is the code step where you set db to CurrentDb?

--

Ken Snell
<MS ACCESS MVP>

Hi All

When I'm trying to run an Access application I'm getting an error
message
:

Object variable or With block variable not set

Bit it's falling over is ;

'And run the query to produce a recordset
Set qdf = db.CreateQueryDef("")
With qdf
.SQL = strSQL
Set rec = .OpenRecordset()
End With

Your help would be very much appreciated

Badger
 
B

Badger04

Morning Ken

I can open the UQCSecurity db direct without any problems!

Various KB search results have suggested that it maybe a dll problems, but
if so I wouldn't know how to resilve this, I have tried changing the
references and has made no difference.

Mark

Ken Snell said:
Does the PC that isn't working have full read/write/delete/create rights to
the folder where the database UQCSecurity.mdb is located?

--

Ken Snell
<MS ACCESS MVP>

Badger04 said:
Hi Ken

error occurs :

Set qdf = db.CreateQueryDef("")

I have just ran the db on a box that hasn't got VB installed and it works
fine, Am I following a red herring with this line of investigation?

Many thanks


Ken Snell said:
On which exact line do you get the "object not set" error?

--

Ken Snell
<MS ACCESS MVP>

Thanks Ken for your attention,
I am thinking it could be referrencing issue as users are running the
production version fine, as my machine is a developer build (with VB,
MDAC
2.6 etc) , unless your knowledge can point me in the right direction.

TIA Badger

Code immediately prior to Set qdf is ;

'Opens external password Protected db to provide details of password
for
user
Dim oAcc As Access.Application

Const TMP = "E:\UQCSecurity.mdb"

Set oAcc = New Access.Application
Set db = oAcc.DBEngine.OpenDatabase(TMP, False, False,
";PWD=Picard359")
oAcc.OpenCurrentDatabase TMP

'Build Query to Select Password for Checking

strSQL = "select Password, UserProfile, DateReview, [Checker No] from
tblPasswords where NTLogon " & _
" = """ & strUserId & """ and Password = """ & strPWD & """"

:

What is the code step where you set db to CurrentDb?

--

Ken Snell
<MS ACCESS MVP>

Hi All

When I'm trying to run an Access application I'm getting an error
message
:

Object variable or With block variable not set

Bit it's falling over is ;

'And run the query to produce a recordset
Set qdf = db.CreateQueryDef("")
With qdf
.SQL = strSQL
Set rec = .OpenRecordset()
End With

Your help would be very much appreciated

Badger
 
K

Ken Snell [MVP]

It may be some type of dll file conflict or such. Unfortunately, I don't
have other suggestions for you about this. Perhaps you could try
reinstalling the software?

--

Ken Snell
<MS ACCESS MVP>

Badger04 said:
Morning Ken

I can open the UQCSecurity db direct without any problems!

Various KB search results have suggested that it maybe a dll problems, but
if so I wouldn't know how to resilve this, I have tried changing the
references and has made no difference.

Mark

Ken Snell said:
Does the PC that isn't working have full read/write/delete/create rights
to
the folder where the database UQCSecurity.mdb is located?

--

Ken Snell
<MS ACCESS MVP>

Badger04 said:
Hi Ken

error occurs :

Set qdf = db.CreateQueryDef("")

I have just ran the db on a box that hasn't got VB installed and it
works
fine, Am I following a red herring with this line of investigation?

Many thanks


:

On which exact line do you get the "object not set" error?

--

Ken Snell
<MS ACCESS MVP>

Thanks Ken for your attention,
I am thinking it could be referrencing issue as users are running
the
production version fine, as my machine is a developer build (with
VB,
MDAC
2.6 etc) , unless your knowledge can point me in the right
direction.

TIA Badger

Code immediately prior to Set qdf is ;

'Opens external password Protected db to provide details of password
for
user
Dim oAcc As Access.Application

Const TMP = "E:\UQCSecurity.mdb"

Set oAcc = New Access.Application
Set db = oAcc.DBEngine.OpenDatabase(TMP, False, False,
";PWD=Picard359")
oAcc.OpenCurrentDatabase TMP

'Build Query to Select Password for Checking

strSQL = "select Password, UserProfile, DateReview, [Checker No]
from
tblPasswords where NTLogon " & _
" = """ & strUserId & """ and Password = """ & strPWD &
""""

:

What is the code step where you set db to CurrentDb?

--

Ken Snell
<MS ACCESS MVP>

Hi All

When I'm trying to run an Access application I'm getting an error
message
:

Object variable or With block variable not set

Bit it's falling over is ;

'And run the query to produce a recordset
Set qdf = db.CreateQueryDef("")
With qdf
.SQL = strSQL
Set rec = .OpenRecordset()
End With

Your help would be very much appreciated

Badger
 
B

Badger04

Ken

Thank you very much for your time on this, if I get to the bottom of it I
will let you know.

Mark

Ken Snell said:
It may be some type of dll file conflict or such. Unfortunately, I don't
have other suggestions for you about this. Perhaps you could try
reinstalling the software?

--

Ken Snell
<MS ACCESS MVP>

Badger04 said:
Morning Ken

I can open the UQCSecurity db direct without any problems!

Various KB search results have suggested that it maybe a dll problems, but
if so I wouldn't know how to resilve this, I have tried changing the
references and has made no difference.

Mark

Ken Snell said:
Does the PC that isn't working have full read/write/delete/create rights
to
the folder where the database UQCSecurity.mdb is located?

--

Ken Snell
<MS ACCESS MVP>

Hi Ken

error occurs :

Set qdf = db.CreateQueryDef("")

I have just ran the db on a box that hasn't got VB installed and it
works
fine, Am I following a red herring with this line of investigation?

Many thanks


:

On which exact line do you get the "object not set" error?

--

Ken Snell
<MS ACCESS MVP>

Thanks Ken for your attention,
I am thinking it could be referrencing issue as users are running
the
production version fine, as my machine is a developer build (with
VB,
MDAC
2.6 etc) , unless your knowledge can point me in the right
direction.

TIA Badger

Code immediately prior to Set qdf is ;

'Opens external password Protected db to provide details of password
for
user
Dim oAcc As Access.Application

Const TMP = "E:\UQCSecurity.mdb"

Set oAcc = New Access.Application
Set db = oAcc.DBEngine.OpenDatabase(TMP, False, False,
";PWD=Picard359")
oAcc.OpenCurrentDatabase TMP

'Build Query to Select Password for Checking

strSQL = "select Password, UserProfile, DateReview, [Checker No]
from
tblPasswords where NTLogon " & _
" = """ & strUserId & """ and Password = """ & strPWD &
""""

:

What is the code step where you set db to CurrentDb?

--

Ken Snell
<MS ACCESS MVP>

Hi All

When I'm trying to run an Access application I'm getting an error
message
:

Object variable or With block variable not set

Bit it's falling over is ;

'And run the query to produce a recordset
Set qdf = db.CreateQueryDef("")
With qdf
.SQL = strSQL
Set rec = .OpenRecordset()
End With

Your help would be very much appreciated

Badger
 

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