Solved

DataEnvironment, connection propertes

Posted on 2004-08-18
7
835 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using YubiKey with REST API application 2 108
bunnyEars challenge 6 103
Help to convert powershell script into a gui 9 142
T-SQL:  Sigh---Boy, this is fun.... 12 34
This is about my first experience with programming Arduino.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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…

867 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

21 Experts available now in Live!

Get 1:1 Help Now