Group:  Microsoft Access ยป microsoft.public.access.modulescoding
Thread: access97 to 2003

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

access97 to 2003
"Wolfgang" <wolfgang[ at ]wafflehouse.com> 14.09.2006 12:52:06
Hi all.
I am in the process of updating an access 97 database to access 2003.
Unitaddr is a linked foxpro table. I am looking for the city based on the
field unit in that table(this is the numeric representation of a location).
The following function worked fine in 97, but will not compile in 2003 on
the rs.city line.

Function fnCity(RUnit)
On Error Resume Next
Dim DB As Database
Dim rs As Recordset
Set DB = CurrentDb()
Set rs = DB.OpenRecordset("unitaddr", DB_OPEN_DYNASET)
rs.FindFirst "[Unitnbr]= " & RUnit & " "
If rs.NoMatch Then
fnCity = "City not Found!"
Else
fnCity = rs.CITY
End If

rs.Close

End Function

Where do I start to correct this problem?
Thank yoiu for your help.
Wolfgang


Re: access97 to 2003
"Alex Dybenko" <alexdyb[ at ]PLEASE.cemi.NO.rssi.SPAM.ru> 14.09.2006 12:58:20
Hi,
make sure you have a reference to DAO360, replace DB_OPEN_DYNASET with
dbOpenDynaset and declare Dim rs As DAO.Recordset

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

"Wolfgang" <wolfgang[ at ]wafflehouse.com> wrote in message
news:%23ZQBXy$1GHA.4632[ at ]TK2MSFTNGP03.phx.gbl...
[Quoted Text]
> Hi all.
> I am in the process of updating an access 97 database to access 2003.
> Unitaddr is a linked foxpro table. I am looking for the city based on the
> field unit in that table(this is the numeric representation of a
> location).
> The following function worked fine in 97, but will not compile in 2003 on
> the rs.city line.
>
> Function fnCity(RUnit)
> On Error Resume Next
> Dim DB As Database
> Dim rs As Recordset
> Set DB = CurrentDb()
> Set rs = DB.OpenRecordset("unitaddr", DB_OPEN_DYNASET)
> rs.FindFirst "[Unitnbr]= " & RUnit & " "
> If rs.NoMatch Then
> fnCity = "City not Found!"
> Else
> fnCity = rs.CITY
> End If
>
> rs.Close
>
> End Function
>
> Where do I start to correct this problem?
> Thank yoiu for your help.
> Wolfgang
>

Re: access97 to 2003
"Wolfgang" <wolfgang[ at ]wafflehouse.com> 14.09.2006 13:11:12
I have made those changes, but still get a "method or data member not found"
compile error on rs.CITY.

"Alex Dybenko" <alexdyb[ at ]PLEASE.cemi.NO.rssi.SPAM.ru> wrote in message
news:exmE11$1GHA.476[ at ]TK2MSFTNGP06.phx.gbl...
[Quoted Text]
> Hi,
> make sure you have a reference to DAO360, replace DB_OPEN_DYNASET with
> dbOpenDynaset and declare Dim rs As DAO.Recordset
>
> --
> Best regards,
> ___________
> Alex Dybenko (MVP)
> http://alexdyb.blogspot.com
> http://www.PointLtd.com
>
> "Wolfgang" <wolfgang[ at ]wafflehouse.com> wrote in message
> news:%23ZQBXy$1GHA.4632[ at ]TK2MSFTNGP03.phx.gbl...
>> Hi all.
>> I am in the process of updating an access 97 database to access 2003.
>> Unitaddr is a linked foxpro table. I am looking for the city based on
>> the field unit in that table(this is the numeric representation of a
>> location).
>> The following function worked fine in 97, but will not compile in 2003 on
>> the rs.city line.
>>
>> Function fnCity(RUnit)
>> On Error Resume Next
>> Dim DB As Database
>> Dim rs As Recordset
>> Set DB = CurrentDb()
>> Set rs = DB.OpenRecordset("unitaddr", DB_OPEN_DYNASET)
>> rs.FindFirst "[Unitnbr]= " & RUnit & " "
>> If rs.NoMatch Then
>> fnCity = "City not Found!"
>> Else
>> fnCity = rs.CITY
>> End If
>>
>> rs.Close
>>
>> End Function
>>
>> Where do I start to correct this problem?
>> Thank yoiu for your help.
>> Wolfgang
>>
>


Re: access97 to 2003
"Brendan Reynolds" <brenreyn[ at ]discussions.microsoft.com> 14.09.2006 13:14:15
Try rs!City or rs.Fields("City")

Recordset.FieldName (e.g. rs.City) is old DAO 2.x syntax. It was supported
for backward compatibility in Access 95 and Access 97 via the DAO 2.x/3.x
compatibility library.

--
Brendan Reynolds
Access MVP

"Wolfgang" <wolfgang[ at ]wafflehouse.com> wrote in message
news:%23ZQBXy$1GHA.4632[ at ]TK2MSFTNGP03.phx.gbl...
[Quoted Text]
> Hi all.
> I am in the process of updating an access 97 database to access 2003.
> Unitaddr is a linked foxpro table. I am looking for the city based on the
> field unit in that table(this is the numeric representation of a
> location).
> The following function worked fine in 97, but will not compile in 2003 on
> the rs.city line.
>
> Function fnCity(RUnit)
> On Error Resume Next
> Dim DB As Database
> Dim rs As Recordset
> Set DB = CurrentDb()
> Set rs = DB.OpenRecordset("unitaddr", DB_OPEN_DYNASET)
> rs.FindFirst "[Unitnbr]= " & RUnit & " "
> If rs.NoMatch Then
> fnCity = "City not Found!"
> Else
> fnCity = rs.CITY
> End If
>
> rs.Close
>
> End Function
>
> Where do I start to correct this problem?
> Thank yoiu for your help.
> Wolfgang
>


Re: access97 to 2003
"Brendan Reynolds" <brenreyn[ at ]discussions.microsoft.com> 14.09.2006 13:14:47
See my response elsewhere in this thread.

--
Brendan Reynolds
Access MVP


"Wolfgang" <wolfgang[ at ]wafflehouse.com> wrote in message
news:eS4gF9$1GHA.1304[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text]
>I have made those changes, but still get a "method or data member not
>found" compile error on rs.CITY.
>
> "Alex Dybenko" <alexdyb[ at ]PLEASE.cemi.NO.rssi.SPAM.ru> wrote in message
> news:exmE11$1GHA.476[ at ]TK2MSFTNGP06.phx.gbl...
>> Hi,
>> make sure you have a reference to DAO360, replace DB_OPEN_DYNASET with
>> dbOpenDynaset and declare Dim rs As DAO.Recordset
>>
>> --
>> Best regards,
>> ___________
>> Alex Dybenko (MVP)
>> http://alexdyb.blogspot.com
>> http://www.PointLtd.com
>>
>> "Wolfgang" <wolfgang[ at ]wafflehouse.com> wrote in message
>> news:%23ZQBXy$1GHA.4632[ at ]TK2MSFTNGP03.phx.gbl...
>>> Hi all.
>>> I am in the process of updating an access 97 database to access 2003.
>>> Unitaddr is a linked foxpro table. I am looking for the city based on
>>> the field unit in that table(this is the numeric representation of a
>>> location).
>>> The following function worked fine in 97, but will not compile in 2003
>>> on the rs.city line.
>>>
>>> Function fnCity(RUnit)
>>> On Error Resume Next
>>> Dim DB As Database
>>> Dim rs As Recordset
>>> Set DB = CurrentDb()
>>> Set rs = DB.OpenRecordset("unitaddr", DB_OPEN_DYNASET)
>>> rs.FindFirst "[Unitnbr]= " & RUnit & " "
>>> If rs.NoMatch Then
>>> fnCity = "City not Found!"
>>> Else
>>> fnCity = rs.CITY
>>> End If
>>>
>>> rs.Close
>>>
>>> End Function
>>>
>>> Where do I start to correct this problem?
>>> Thank yoiu for your help.
>>> Wolfgang
>>>
>>
>
>


Re: access97 to 2003
"Wolfgang" <wolfgang[ at ]wafflehouse.com> 14.09.2006 13:32:00
Using rs!City did the trick.
Thank you very much!

"Brendan Reynolds" <brenreyn[ at ]discussions.microsoft.com> wrote in message
news:O5N%23x%23$1GHA.4648[ at ]TK2MSFTNGP04.phx.gbl...
[Quoted Text]
> Try rs!City or rs.Fields("City")
>
> Recordset.FieldName (e.g. rs.City) is old DAO 2.x syntax. It was supported
> for backward compatibility in Access 95 and Access 97 via the DAO 2.x/3.x
> compatibility library.
>
> --
> Brendan Reynolds
> Access MVP
>
> "Wolfgang" <wolfgang[ at ]wafflehouse.com> wrote in message
> news:%23ZQBXy$1GHA.4632[ at ]TK2MSFTNGP03.phx.gbl...
>> Hi all.
>> I am in the process of updating an access 97 database to access 2003.
>> Unitaddr is a linked foxpro table. I am looking for the city based on
>> the field unit in that table(this is the numeric representation of a
>> location).
>> The following function worked fine in 97, but will not compile in 2003 on
>> the rs.city line.
>>
>> Function fnCity(RUnit)
>> On Error Resume Next
>> Dim DB As Database
>> Dim rs As Recordset
>> Set DB = CurrentDb()
>> Set rs = DB.OpenRecordset("unitaddr", DB_OPEN_DYNASET)
>> rs.FindFirst "[Unitnbr]= " & RUnit & " "
>> If rs.NoMatch Then
>> fnCity = "City not Found!"
>> Else
>> fnCity = rs.CITY
>> End If
>>
>> rs.Close
>>
>> End Function
>>
>> Where do I start to correct this problem?
>> Thank yoiu for your help.
>> Wolfgang
>>
>
>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net