Solved

DataEnvironment, connection propertes

Posted on 2004-08-18
7
831 Views
Last Modified: 2012-06-27
Hi

I have a db in access2000 with a password set on it
what i have in my moudule is:
DataEnvironment1.Connection1.ConnectionString = "Provider=MicroSoft.jet.oledb.4.0; Data Source =" & App.Path & "\mydb.mdb" & "; Jet OLEDB:Database Password=mypassword;"

and i think it fine ..
but as i am in the designing phase , i tried to set up my connection propertes ,but when i try to test the connection it wont work, it gives me errors either thats its wrong password or the db is opend exsclusivly or something by another user ......

Now i am sure my problem is that my db is with a password on it ,,,

so whats the right settings for the connection ??

Thanks,
KASS

 
0
Comment
Question by:Mahdi Mansour
  • 4
  • 3
7 Comments
 
LVL 2

Expert Comment

by:zonaltech
ID: 11830285
Is there any specific reason you are using an OLEDB/Jet type connection string? Here is what I use to connect to my Access2000 database:

Const strConnect As String = "Driver={Microsoft Access Driver (*.mdb)};" & _
    "Dbq=C:\HelpDesk\HelpDeskTicket.mdb;" & _
    "Uid=admin;" & _
    "Pwd=;"

("admin" is the default username, by the way.)

Just substitute the path to your MDB, and fill in the password, and let me know how that works for you!
0
 
LVL 1

Author Comment

by:Mahdi Mansour
ID: 11830574
no specific reason for me using the OLEDB/Jet type , isn't it good enough ?!

anyway my problem is not in connecting to the database, its now i am desgning the reports so i made the DataEnvironment and its connection so i can add commands and make data reports.
now for my commands to work and bring me the fields from my tables in the db so i can just drag and drop them in the data report the connection propertes (of this connection) must be correctly set, here my problem in the connection properte i spicify my password and i dont know what to do with the user name? i tried to make it blank or use the defualt Admin but nothing is working ...

0
 
LVL 2

Expert Comment

by:zonaltech
ID: 11830841
How are you setting the connection properties? Using the properties editor?

I should have seen this earlier, because I am working on an MDB project myself, but you said something about it complaining about the database being opened exclusively? Do you have MS Access open currently? Perhaps editing a table or other object?

When you are editing the database, it locks it so no one else can connect and mess it up. So make sure you arent editing anything in the database before testing the connection. Close any Design-View tables or queries, and try again.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 2

Expert Comment

by:zonaltech
ID: 11830905
Also, an article explaining a similar situation is located here:

"Error with connection to Access.mdb file"
http://www.dotnet247.com/247reference/msgs/22/110486.aspx

Notice the solution involved uses the simpler connection string, I strongly suggest using the simpler string as well.
0
 
LVL 1

Author Comment

by:Mahdi Mansour
ID: 11838998
of course my db closed and not opened when i try the connection, and yes i am using the properte editor
as i said its the propertes of the connection of the DataEnvironment ..

i want to do data reports , so the connection of the DataEnvironment that i have problems setting the propertes for the db password

its not that i am using OLEDB/Jet type  or even if i am using simpler connections , i dont have any problems with the oledb\jet connection , its the connection of the dataenvironments ..




0
 
LVL 2

Accepted Solution

by:
zonaltech earned 65 total points
ID: 11842429
Ohhh, you arent using the:

DataEnvironment1.Connection1.ConnectionString = "Provider=MicroSoft.jet.oledb.4.0; Data Source =" & App.Path & "\mydb.mdb" & "; Jet OLEDB:Database Password=mypassword;"

because you are in Design Mode, and you're trying to duplicate it to connect in the designer separately, right? Just to get the fields set up correctly?

Ok, the easiest way is to make a 'temporary' version of the Connection String you made earlier. Like:

Provider=MicroSoft.jet.oledb.4.0; Data Source=c:\MyVbProject\mydb.mdb; Jet OLEDB:Database Password=mypassword;

Then copy and paste that into the ConnectionSource property of the connection object in the DataEnvironment or paste it into the properties window under "Use Connection String". How does that work for you?
0
 
LVL 1

Author Comment

by:Mahdi Mansour
ID: 11862632
Ya finally u understand what i want :)
Thanks for the help
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This is about my first experience with programming Arduino.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now