Re: Method '~' of object '~' failed error while opening ADODB connection in vb6
- From: Alan <fyz@xxxxxxxxxxxxx>
- Date: Sun, 11 May 2008 07:08:03 -0700 (PDT)
On Apr 17, 10:01 pm, swapna.munuk...@xxxxxxxxx wrote:
On Apr 17, 6:45 pm, "Ralph" <nt_consultin...@xxxxxxxxx> wrote:
<swapna.munuk...@xxxxxxxxx> wrote in message
news:226a8986-65c2-4448-8931-2a44b14cea33@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi all,
I am using VB6, MS-Access2000 for my application. The application is
running fine from IDE. But when it is build and run using the
binaries, it is throwing the error "Method '~' of object '~' failed".
When put messages, I found that in the following code, the last line
causing the error.
Dim mcnDBData As ADODB.Connection
Set mcnDBData = New ADODB.Connection
Dim strConnectionString as string
strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:
\Data\Test.mdb;Persist Security Info=False;Jet OLEDB: Database
Password=LFSGenesis;"
Call mcnDBData.Open(strConnectionString)
Can anybody let me know what can cause such an error?
You left out a few pieces of important information.
1) What O/S are you using?
2) Is this something that happens all the time, or just something that
happens for this one specific project.
If "all the time" for "all projects", then the most common reason is because
the MDAC or Jet installation is "corrupt" (anything from incorrect
registration, wrong version, mismatched to bad components). You can use this
utility to check the MDAC out.http://www.microsoft.com/downloads/details..aspx?FamilyID=8f0a8df6-4a2...
Normally it is just easier to re-install the appropriate MDAC or Jet for
your O/S.
MDAChttp://msdn2.microsoft.com/en-us/data/aa937729.aspx
Jethttp://support.microsoft.com/kb/239114/
Note that these are all dependent on the OS you are using.
For example, if using Vista - you can't install the MDAC as it already comes
with its own DAC.
If you are using Win2000 then you may also need to install the latest
service pack.http://support.microsoft.com/kb/260910/en-us
I included the above information because it is useful to know. However, if
this is only a problem for a specific project then I would question that
connection string. (You might also check your Project References.)
You can use the "Data Link" utility to create and *test* your connection..
Look up "Data Link" in Windows Help (from the start or globe menu). You
create a blank file with a ".udl" extension and then double-click it in
Explorer to open the Data Link dialog. After testing and saving - you can
then open the file with notepad and copy the string to your program.
hth
-ralph- Hide quoted text -
- Show quoted text -
Thanks for your suggestions...
My work environment:
OS: Win 2k
MDAC is not installed separately. It has come along with I think
Microsoft visual Studio.
In project references it lists "Microsoft ActiveX Data Objects 2.5
library", "Microsoft ActiveX Data Objects 2.6 library", "Microsoft
ActiveX Data Objects 2.7 library", "Microsoft ActiveX Data Objects 2.0
library".
What ever version is chosen, it is throwing the same error.
It never happened before. This is the first time I am facing this
error. I am using the same system for the same application for years.
In the same machine, the application is working fine for the same
connection string thru IDE.
Regards,
Swapna- Hide quoted text -
- Show quoted text -
Hi,
Perhaps the mdb file is corrupt. If necessary, I think you can try a
utility called Advanced Access Repair to repair your Access MDB file.
It works rather well for my corrupt Access MDB files. Its web address
is http://www.datanumen.com/aar/
Alan
.
- Prev by Date: ASP/ADO/VB.NET: How to update multiple datatables with typed datasets ?
- Next by Date: Re: ASP/ADO/VB.NET: How to update multiple datatables with typed datasets ?
- Previous by thread: ASP/ADO/VB.NET: How to update multiple datatables with typed datasets ?
- Next by thread: vb5 versus vb2008
- Index(es):
Relevant Pages
|