[AccessD] Problem converting code

Charlotte Foust cfoust at infostatsystems.com
Thu Jan 5 11:33:00 CST 2006


You may need to specify the type of recordset, John.  If I remember
correctly, the default changed with A2k to something like ForwardOnly.
On the other hand, you haven't posted the SQL, so there may be a problem
in it.  Once thing to watch out for is that A97 accepted things like
Forms!MyForm![ControlName] as a parameter in a query and saved them that
way, while converting that query to a later version results in
[Forms!MyForm![ControlName]] in the parameter and a parameter error when
the query is accessed.  To fix it, you have to go through each query
parameters and correct the bracketing.  Brackets are required around
EACH element when you reference a form object.

Charlotte Foust


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Clark
Sent: Thursday, January 05, 2006 9:00 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Problem converting code


I figured it was something like this, but I added the reference to ADO
3.51, which is what is in A97, and made sure it was above ADO, but it
still gives me an error on that line, saying that there are "Two few
parameters. Expected 1." Now, when I first tried using this, I was
getting "can't find tblMain" which isn't even in the code anywhere that
I can find.

>>> wdhindman at bellsouth.net 1/5/2006 9:31 AM >>>
...and don't forget to set the DAO reference higher in the list than the
ADO 
reference ...or remove the ADO reference altogether.

William

----- Original Message ----- 
From: "Bryan Carbonnell" <carbonnb at gmail.com>
To: "Access Developers discussion and problem solving" 
<accessd at databaseadvisors.com>
Sent: Thursday, January 05, 2006 9:21 AM
Subject: Re: [AccessD] Problem converting code


> On 05/01/06, John Clark <John.Clark at niagaracounty.com> wrote:
>
>> The bigger problem though is that this was done in A97 and I am now 
>> using A2K. I will be redoing this program in A2K and the program I
am
>> currently working on and trying to reuse the code in, is also A2K. I
am
>> getting errors on the line, "Set rst =
CodeDb.OpenRecordset(strSQL)"
>> that says too few parameters. I am either being totally dense (a 
>> distinct possibility) or it is a DAO vs. ADO problem, which I can
not
>> get through my skull and always have problems with...making me
dense
>> again...hmmmm.
>
> It appears to be DAO code, so you will need to add a reference to
DAO.
> A2K defaults to ADO.
>
>



More information about the AccessD mailing list