Convert to Access 97

B

bd_jlrfreitas

I need to run one application made on Access 2000 in a Access 97
version and I did the conversion to Access 97. I have two errors, one
at Enum and other at Ado connection because Access 97 don't have
Application.Connection. How can I resolve theses situations without
made big changes on the code?

[]'s
BD
[]'s
BD
 
D

Douglas J. Steele

Wherever your code refers to an enum as a data type, replace it with Long.

Wherever your code uses Application.Connection, put an explicit connection
string.
 
B

bd_jlrfreitas

Thanks.
You mean if I have something like this:

Enum Width
short
big
End Enum

Replace with:
Dim short As Long
Dim big As Long

And if I have in a call function this situation:

Sub some(t as Width)
if t =short then

How I replace theses parameters?
May be like this?

Sub some(t as Long)
if t =0 then

Or is better using constant?

Const short As Long = 0
Const big As Long = 1


[]'s
BD
 
D

Douglas J. Steele

Dim short As Long
Dim big As Long

isn't necessary (and, in fact, won't work).

Const short As Long = 0
Const big As Long = 1

is necessary.

Then, you can replace

Sub some(t as Width)
if t =short then

with

Sub some(t as Long)
if t =short then


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Thanks.
You mean if I have something like this:

Enum Width
short
big
End Enum

Replace with:
Dim short As Long
Dim big As Long

And if I have in a call function this situation:

Sub some(t as Width)
if t =short then

How I replace theses parameters?
May be like this?

Sub some(t as Long)
if t =0 then

Or is better using constant?

Const short As Long = 0
Const big As Long = 1


[]'s
BD


Wherever your code refers to an enum as a data type, replace it with Long.

Wherever your code uses Application.Connection, put an explicit connection
string.
 
P

Pat Hartman\(MVP\)

You can try adding the ADO library to the references collection
(Tools/References) to fix your ADO problem. Make sure that the ADO library
is placed ahead of the DAO library in the references collection.
I haven't done this so I can't guarantee that it will work but it is worth a
try. Otherwise, you'll need to replace all the ADO code with DAO. Keep in
mind that if the database uses both ADO and DAO, you will need to
disambiguate ALL references so that Access knows when you are referring to
an ADO object and when you are referring to a DAO object.
Dim rs1 As DAO.Recordset
Dim rs2 As ADO.Recordset
etc.
 
B

BD

Adding a reference to ADO and write a explicit connection like
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;User
Id=admin;Password=;"
resolve my problem because I always declare the variables with
Dim obj as ADO.obj

[]'s
BD
 

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