Access 2003 para 2007

F

Fernanda

Hello.
I Installed Access 2007 in my machine.
I did an application using access 2003 and now I converted.
I had a lot of problems with access 2007. My application stopped. VBA code
were not called. So, I discovered that access 2007 has a way to enable macros
and set truth paths. Ok, my VBA code was called.
But now I have the problem...A message appear in my forms:

''Erro em tempo de execução '13': Tipos de dados incompatíveis"

In access 2003 this kind of error not appear. What should I do ?

Tks
 
A

Allen Browne

Someone who can translate the error message may be able to give a better
answer, but I'm going to have a guess that it is a message about
'mis-matched data types.'

Firstly, you say you have the code running (so presumably you have the
folder trusted), but it is still giving problems. Could I suggest you run
through these standard recovery steps:
http://allenbrowne.com/recover.html
It deals with things like Name AutoCorrect, compact, decompile (with compact
again), and compiling again after setting minimal references.

Next, you are trying to deal with error 13 in VBA code. Temporarily disable
any error handling, by adding a single quote mark to any line that calls an
error handler, e.g.:
'On Error Goto ...
Now when the error occurs, you can see the line that caused it. This will
help identify where it is going wrong. The type mismatch basically means
that VBA was expecting one type of data (e.g. a number), but the value it
received was something else (e.g. a string of text.)

To debug the problem, you trace back where the data came from, and why it is
not the correct type. If necessary typecast, e.g. use CVDate() to convert to
a date, CStr() to convert to a string, CCur() to convert to currency etc.
Watch nulls: functions such as CLng() and CDbl() can't handle them.

If your VBA function is being called from a query, looking at the query
results in datasheet view will give you a visual clue about how Access
understands the field. If the column is left-aligned, Access is treating it
as text; numbers and dates will right-align. There's a bit more detail about
there in this article:
Common query hurdles - Mistakes that slow down your queries
at:
http://allenbrowne.com/QueryPerfIssue.html

The essential concept is to think about the data types of your fields and
variables, and understand why Access might be misunderstanding them.

Finally, some othe general suggestions that may help you adapt to A2007:
http://allenbrowne.com/Access2007.html

HTH
 
F

Fernanda

Hi Allen.

I resolved this problem in my machine... See this link:

http://support.microsoft.com/kb/927678

The message in english is:

Run-time error ‘13’:
Type mismatch

Application runs in my machine now, without error message.

But now I have another problem. I generated a solution package to install in
user machine that don´t have access... and the error appeared again. In my
machine nothing appear. The package has RunTime and just application.

Do you have any idea ?
Tks






"Allen Browne" escreveu:
 
A

Allen Browne

So the issue was bad references.

Either use method 3 of that article (i.e. remove the library you don't
need), or use method 2 (explicitly declare the type of recordset you need),
or both.

More information about references for each version of Access:
http://allenbrowne.com/ser-38.html
 
F

Fernanda

Hi Allen. I used Method 1 of: http://support.microsoft.com/kb/927678

This is the reference order in Access ( my machine ):


x Visual Basic For Applications
x Microsoft Access 12.0 Object Library
x Microsoft Office 12.0 Access database engine Object library
x Microsoft ActiveX data Objects 2.0 Library
x OLE Automation
x Microsoft Visual Basic for Application Extensibility 5.3


I changed the priority of the DAO library, by moving it above ADO.
In your site, there are more 2 steps.

--Remove the reference to either the ADO or the DAO library. (See below.)
--Disambiguate each declaration, by specifying the library you intend, e.g.:
Dim rs As DAO.Recordset

Should I do these steps too?

Tks




"Allen Browne" escreveu:
 
A

Allen Browne

Fernanda said:
Hi Allen. I used Method 1 of: http://support.microsoft.com/kb/927678

In your site, there are more 2 steps:
--Remove the reference to either the ADO or the DAO library. (See below.)
--Disambiguate each declaration, by specifying the library you intend,
e.g.:
Dim rs As DAO.Recordset

Should I do these steps too?

Yes.

(And FYI, that's what the KB you referenced said also.)
 

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