Solved

DataEnvironment, connection propertes

Posted on 2004-08-18
7
839 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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 …

756 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