473,386 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Permanent Reference using VBE

CFW
References in Access and .mdb files have always been painful for me -
just when I thought I was OK in an .mdb, I have a .adp I'm working on
and I need to use Set db as CurrentDb - Constant "object variable or
with block variable not set" error almost killed me and VB Help says

"If you want to use the CurrentDb method in an Access project (.adp)
you must set a permanent reference to the DAO 3.6 Object library in
the Microsoft Visual Basic Editor."

How do I set a "Permanent" reference? As opposed to another kind?

TIA
Nov 12 '05 #1
6 2119
On Thu, 15 Jan 2004 04:21:46 GMT, CFW <ch***@thewilkfamily.com> wrote:

That's probably not MSFT's finest work. There is no other kind (if you
don't consider late binding).

First off you have to realize that ADPs are about using ADO against a
SQL Server back-end. Doing anything outside of this mold is an
advanced topic. The advice to drag DAO into this is somewhat off base
for 95% of the ADP applications.

Knowing you're now in an ADO environment immediately breaks some of
the DAO code you may be more comfortable with. No more CurrentDB, no
more (DAO.)Recordset. Welcome Connection object, ADODB.Recordset
object, etc.

-Tom.

References in Access and .mdb files have always been painful for me -
just when I thought I was OK in an .mdb, I have a .adp I'm working on
and I need to use Set db as CurrentDb - Constant "object variable or
with block variable not set" error almost killed me and VB Help says

"If you want to use the CurrentDb method in an Access project (.adp)
you must set a permanent reference to the DAO 3.6 Object library in
the Microsoft Visual Basic Editor."

How do I set a "Permanent" reference? As opposed to another kind?

TIA


Nov 12 '05 #2
CFW
Thanks for the response. That's exactly what I resorted to "Set New
ADODB.Recordset as Recordset" . . . etc. Can I ask a follow-up . . .
this is new to me - using the "Builder . . . " in a .mdb database
within the criteria cell to create a query I could do in my sleep.
With a .adp project, there is no "Builder . . . " and I can't seem to
get the syntax to set the criteria for a column in a "view" to refer
to a control on an open form. = Forms!frmSomeForm!cboSomeComboBox
used to work great! What am I missing? TIA!

On Wed, 14 Jan 2004 22:37:01 -0700, Tom van Stiphout
<to*****@no.spam.cox.net> wrote:
On Thu, 15 Jan 2004 04:21:46 GMT, CFW <ch***@thewilkfamily.com> wrote:

That's probably not MSFT's finest work. There is no other kind (if you
don't consider late binding).

First off you have to realize that ADPs are about using ADO against a
SQL Server back-end. Doing anything outside of this mold is an
advanced topic. The advice to drag DAO into this is somewhat off base
for 95% of the ADP applications.

Knowing you're now in an ADO environment immediately breaks some of
the DAO code you may be more comfortable with. No more CurrentDB, no
more (DAO.)Recordset. Welcome Connection object, ADODB.Recordset
object, etc.

-Tom.

References in Access and .mdb files have always been painful for me -
just when I thought I was OK in an .mdb, I have a .adp I'm working on
and I need to use Set db as CurrentDb - Constant "object variable or
with block variable not set" error almost killed me and VB Help says

"If you want to use the CurrentDb method in an Access project (.adp)
you must set a permanent reference to the DAO 3.6 Object library in
the Microsoft Visual Basic Editor."

How do I set a "Permanent" reference? As opposed to another kind?

TIA


Nov 12 '05 #3
On Thu, 15 Jan 2004 12:52:16 GMT, CFW <ch***@thewilkfamily.com> wrote:

Still works the same way. In the NorthwindCS sample app, I ran the
Employee, and then added a textbox to the Orders form with a
ControlSource of:
=[Forms]![Employees]![FirstName]
(Access provided the bracketing)
And it correctly pulled up the first name of the employee.

-Tom.
Thanks for the response. That's exactly what I resorted to "Set New
ADODB.Recordset as Recordset" . . . etc. Can I ask a follow-up . . .
this is new to me - using the "Builder . . . " in a .mdb database
within the criteria cell to create a query I could do in my sleep.
With a .adp project, there is no "Builder . . . " and I can't seem to
get the syntax to set the criteria for a column in a "view" to refer
to a control on an open form. = Forms!frmSomeForm!cboSomeComboBox
used to work great! What am I missing? TIA!

On Wed, 14 Jan 2004 22:37:01 -0700, Tom van Stiphout
<to*****@no.spam.cox.net> wrote:
On Thu, 15 Jan 2004 04:21:46 GMT, CFW <ch***@thewilkfamily.com> wrote:

That's probably not MSFT's finest work. There is no other kind (if you
don't consider late binding).

First off you have to realize that ADPs are about using ADO against a
SQL Server back-end. Doing anything outside of this mold is an
advanced topic. The advice to drag DAO into this is somewhat off base
for 95% of the ADP applications.

Knowing you're now in an ADO environment immediately breaks some of
the DAO code you may be more comfortable with. No more CurrentDB, no
more (DAO.)Recordset. Welcome Connection object, ADODB.Recordset
object, etc.

-Tom.

References in Access and .mdb files have always been painful for me -
just when I thought I was OK in an .mdb, I have a .adp I'm working on
and I need to use Set db as CurrentDb - Constant "object variable or
with block variable not set" error almost killed me and VB Help says

"If you want to use the CurrentDb method in an Access project (.adp)
you must set a permanent reference to the DAO 3.6 Object library in
the Microsoft Visual Basic Editor."

How do I set a "Permanent" reference? As opposed to another kind?

TIA


Nov 12 '05 #4
I'm sorry - I was not clear . . . The following perfectly fine SQL
syntax in a query in a .mdb results in a "Error in WHERE clause near
'!'. Unable to parse query text" error message when used in an .adp
SQL Query pane. I can't get the syntax right for referring to a
control on a running form for the criteria of a particular column - in
this case, the FuneralHome column.

SELECT [_tblFuneralHome].FuneralHome, [_tblFuneralHome].AddrLine1,
[_tblFuneralHome].AddrLine2, [_tblFuneralHome].City,
[_tblFuneralHome].State, [_tblFuneralHome].Zip
FROM _tblFuneralHome
WHERE
((([_tblFuneralHome].FuneralHome)=[Forms]![frmCremation]![cboFuneralHome]));
On Thu, 15 Jan 2004 07:00:34 -0700, Tom van Stiphout
<to*****@no.spam.cox.net> wrote:
On Thu, 15 Jan 2004 12:52:16 GMT, CFW <ch***@thewilkfamily.com> wrote:

Still works the same way. In the NorthwindCS sample app, I ran the
Employee, and then added a textbox to the Orders form with a
ControlSource of:
=[Forms]![Employees]![FirstName]
(Access provided the bracketing)
And it correctly pulled up the first name of the employee.

-Tom.
Thanks for the response. That's exactly what I resorted to "Set New
ADODB.Recordset as Recordset" . . . etc. Can I ask a follow-up . . .
this is new to me - using the "Builder . . . " in a .mdb database
within the criteria cell to create a query I could do in my sleep.
With a .adp project, there is no "Builder . . . " and I can't seem to
get the syntax to set the criteria for a column in a "view" to refer
to a control on an open form. = Forms!frmSomeForm!cboSomeComboBox
used to work great! What am I missing? TIA!

On Wed, 14 Jan 2004 22:37:01 -0700, Tom van Stiphout
<to*****@no.spam.cox.net> wrote:
On Thu, 15 Jan 2004 04:21:46 GMT, CFW <ch***@thewilkfamily.com> wrote:

That's probably not MSFT's finest work. There is no other kind (if you
don't consider late binding).

First off you have to realize that ADPs are about using ADO against a
SQL Server back-end. Doing anything outside of this mold is an
advanced topic. The advice to drag DAO into this is somewhat off base
for 95% of the ADP applications.

Knowing you're now in an ADO environment immediately breaks some of
the DAO code you may be more comfortable with. No more CurrentDB, no
more (DAO.)Recordset. Welcome Connection object, ADODB.Recordset
object, etc.

-Tom.
References in Access and .mdb files have always been painful for me -
just when I thought I was OK in an .mdb, I have a .adp I'm working on
and I need to use Set db as CurrentDb - Constant "object variable or
with block variable not set" error almost killed me and VB Help says

"If you want to use the CurrentDb method in an Access project (.adp)
you must set a permanent reference to the DAO 3.6 Object library in
the Microsoft Visual Basic Editor."

How do I set a "Permanent" reference? As opposed to another kind?

TIA


Nov 12 '05 #5
On Fri, 16 Jan 2004 02:03:15 GMT, Chris Wilk <ch***@thewilkfamily.com>
wrote:

No can do. And for a good reason. What you call the SQL Query pane is
used to create Views. Views are SQL Server objects, stored in the
server, and executed by and on the server. These objects don't know
which client invoked them and what the values in the controls of their
forms might be.

Better to use a stored procedure that takes an argument, and use the
InputParameters property of the form to supply the value. You may set
it to an expression like [Forms]![frmCremation]![cboFuneralHome].

Get away from the thought that ADP is the same as MDB. I can recommend
Getz et al's Access Developer Handbook. I believe Part 2 has a big
section on ADP. Required reading.

-Tom.
I'm sorry - I was not clear . . . The following perfectly fine SQL
syntax in a query in a .mdb results in a "Error in WHERE clause near
'!'. Unable to parse query text" error message when used in an .adp
SQL Query pane. I can't get the syntax right for referring to a
control on a running form for the criteria of a particular column - in
this case, the FuneralHome column.

SELECT [_tblFuneralHome].FuneralHome, [_tblFuneralHome].AddrLine1,
[_tblFuneralHome].AddrLine2, [_tblFuneralHome].City,
[_tblFuneralHome].State, [_tblFuneralHome].Zip
FROM _tblFuneralHome
WHERE
((([_tblFuneralHome].FuneralHome)=[Forms]![frmCremation]![cboFuneralHome]));
On Thu, 15 Jan 2004 07:00:34 -0700, Tom van Stiphout
<to*****@no.spam.cox.net> wrote:
On Thu, 15 Jan 2004 12:52:16 GMT, CFW <ch***@thewilkfamily.com> wrote:

Still works the same way. In the NorthwindCS sample app, I ran the
Employee, and then added a textbox to the Orders form with a
ControlSource of:
=[Forms]![Employees]![FirstName]
(Access provided the bracketing)
And it correctly pulled up the first name of the employee.

-Tom.
Thanks for the response. That's exactly what I resorted to "Set New
ADODB.Recordset as Recordset" . . . etc. Can I ask a follow-up . . .
this is new to me - using the "Builder . . . " in a .mdb database
within the criteria cell to create a query I could do in my sleep.
With a .adp project, there is no "Builder . . . " and I can't seem to
get the syntax to set the criteria for a column in a "view" to refer
to a control on an open form. = Forms!frmSomeForm!cboSomeComboBox
used to work great! What am I missing? TIA!

On Wed, 14 Jan 2004 22:37:01 -0700, Tom van Stiphout
<to*****@no.spam.cox.net> wrote:

On Thu, 15 Jan 2004 04:21:46 GMT, CFW <ch***@thewilkfamily.com> wrote:

That's probably not MSFT's finest work. There is no other kind (if you
don't consider late binding).

First off you have to realize that ADPs are about using ADO against a
SQL Server back-end. Doing anything outside of this mold is an
advanced topic. The advice to drag DAO into this is somewhat off base
for 95% of the ADP applications.

Knowing you're now in an ADO environment immediately breaks some of
the DAO code you may be more comfortable with. No more CurrentDB, no
more (DAO.)Recordset. Welcome Connection object, ADODB.Recordset
object, etc.

-Tom.
>References in Access and .mdb files have always been painful for me -
>just when I thought I was OK in an .mdb, I have a .adp I'm working on
>and I need to use Set db as CurrentDb - Constant "object variable or
>with block variable not set" error almost killed me and VB Help says
>
>"If you want to use the CurrentDb method in an Access project (.adp)
>you must set a permanent reference to the DAO 3.6 Object library in
>the Microsoft Visual Basic Editor."
>
>How do I set a "Permanent" reference? As opposed to another kind?
>
>TIA


Nov 12 '05 #6
CFW
Thanks Tom - I'm getting the book today!

On Thu, 15 Jan 2004 21:39:44 -0700, Tom van Stiphout
<to*****@no.spam.cox.net> wrote:
On Fri, 16 Jan 2004 02:03:15 GMT, Chris Wilk <ch***@thewilkfamily.com>
wrote:

No can do. And for a good reason. What you call the SQL Query pane is
used to create Views. Views are SQL Server objects, stored in the
server, and executed by and on the server. These objects don't know
which client invoked them and what the values in the controls of their
forms might be.

Better to use a stored procedure that takes an argument, and use the
InputParameters property of the form to supply the value. You may set
it to an expression like [Forms]![frmCremation]![cboFuneralHome].

Get away from the thought that ADP is the same as MDB. I can recommend
Getz et al's Access Developer Handbook. I believe Part 2 has a big
section on ADP. Required reading.

-Tom.
I'm sorry - I was not clear . . . The following perfectly fine SQL
syntax in a query in a .mdb results in a "Error in WHERE clause near
'!'. Unable to parse query text" error message when used in an .adp
SQL Query pane. I can't get the syntax right for referring to a
control on a running form for the criteria of a particular column - in
this case, the FuneralHome column.

SELECT [_tblFuneralHome].FuneralHome, [_tblFuneralHome].AddrLine1,
[_tblFuneralHome].AddrLine2, [_tblFuneralHome].City,
[_tblFuneralHome].State, [_tblFuneralHome].Zip
FROM _tblFuneralHome
WHERE
((([_tblFuneralHome].FuneralHome)=[Forms]![frmCremation]![cboFuneralHome]));
On Thu, 15 Jan 2004 07:00:34 -0700, Tom van Stiphout
<to*****@no.spam.cox.net> wrote:
On Thu, 15 Jan 2004 12:52:16 GMT, CFW <ch***@thewilkfamily.com> wrote:

Still works the same way. In the NorthwindCS sample app, I ran the
Employee, and then added a textbox to the Orders form with a
ControlSource of:
=[Forms]![Employees]![FirstName]
(Access provided the bracketing)
And it correctly pulled up the first name of the employee.

-Tom.

Thanks for the response. That's exactly what I resorted to "Set New
ADODB.Recordset as Recordset" . . . etc. Can I ask a follow-up . . .
this is new to me - using the "Builder . . . " in a .mdb database
within the criteria cell to create a query I could do in my sleep.
With a .adp project, there is no "Builder . . . " and I can't seem to
get the syntax to set the criteria for a column in a "view" to refer
to a control on an open form. = Forms!frmSomeForm!cboSomeComboBox
used to work great! What am I missing? TIA!

On Wed, 14 Jan 2004 22:37:01 -0700, Tom van Stiphout
<to*****@no.spam.cox.net> wrote:

>On Thu, 15 Jan 2004 04:21:46 GMT, CFW <ch***@thewilkfamily.com> wrote:
>
>That's probably not MSFT's finest work. There is no other kind (if you
>don't consider late binding).
>
>First off you have to realize that ADPs are about using ADO against a
>SQL Server back-end. Doing anything outside of this mold is an
>advanced topic. The advice to drag DAO into this is somewhat off base
>for 95% of the ADP applications.
>
>Knowing you're now in an ADO environment immediately breaks some of
>the DAO code you may be more comfortable with. No more CurrentDB, no
>more (DAO.)Recordset. Welcome Connection object, ADODB.Recordset
>object, etc.
>
>-Tom.
>
>
>>References in Access and .mdb files have always been painful for me -
>>just when I thought I was OK in an .mdb, I have a .adp I'm working on
>>and I need to use Set db as CurrentDb - Constant "object variable or
>>with block variable not set" error almost killed me and VB Help says
>>
>>"If you want to use the CurrentDb method in an Access project (.adp)
>>you must set a permanent reference to the DAO 3.6 Object library in
>>the Microsoft Visual Basic Editor."
>>
>>How do I set a "Permanent" reference? As opposed to another kind?
>>
>>TIA


Nov 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: john_pongo | last post by:
Greetings esteemed peers & colleagues, I've downloaded & installed (full) IBM's Websphere App Developer 5 IDE trialware. Now my company has purchased the product, and I'm wondering if it's...
3
by: Melanie | last post by:
In AccessXP(A2000 mode), how do I make the change of references from ADO to DAO3.6 permanent? I go into references and uncheck ADO then scroll down to DAO3.6 and check it. I close references and...
1
by: Kenny M. | last post by:
At Design time I'm using an specific font and I want it to be permanet on my site from every pc I connect to, How Can it be done? thks.
0
by: John | last post by:
Hi Is it possible to have a permanent vertical scroll bar with datagridview, like we can have in the listbox using the ScrollAlwaysVisible property? Thanks Regards
4
by: nunnasujatha | last post by:
Hi all, i ve tried to convert a permanent tablespace to temporary. for this i 've used alter tablespace test_per_ts temporary; ERROR:invalid option for create/alter tablespace. ...
4
by: Jurgen Haan | last post by:
Hi hi everyone. We have upgraded our DB2 LUW 8.2.1 which was directly installed from our DB2 CD's to DB2 LUW 8.2.6 (FP13). (system: HP DL385 (AMD64), single socket, dual core. 8GB memory. SLES...
1
by: patrickdrd | last post by:
Hi all! Does anyone know of a way to keep a permanent url throughout a user's browsing? For example, if my web site's address is http://www.mysite.com, I have noticed that some sites keep that...
5
TheServant
by: TheServant | last post by:
Hey guys Long time no see, hope you are all well. Been pretty busy at work, so not much time to continue all my programming adventures! I do however want to re-focus on it and I was wondering if...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.