473,320 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

setting Access in C#

ok,
I'm lost at how to try this.... any pointers on
how to set the password of an access DB within C#?

this is what I tried:

string strDestDB2 = "NewMdb.mdb";
string strSourceConnect2 = "Data Source=" + strDestDB;
string strDestConnect2 = "Data Source=" + strDestDB2
+ ";Jet OLEDB:Password="+SAPassword;
jetEngine.CompactDatabase(strSourceConnect2,
strDestConnect2);

John

Jul 21 '05 #1
2 1370
Hi John,

Here you go
@"Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet
OLEDB:Database Locking Mode=1;Jet OLEDB:Database Password=YOURPASSWORD;Data
Source=""DATABASE"";Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global Bulk
Transactions=1;Provider=""Microsoft.Jet.OLEDB.4.0" ";Jet OLEDB:System
database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Share Deny None;Jet
OLEDB:New Database Password=;Jet OLEDB:Create System Database=False;Jet
OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica
Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False"

If you are using password set on database you should set OLEDB:Database
Password (and not Password) connection string property.
--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

"John K" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
ok,
I'm lost at how to try this.... any pointers on
how to set the password of an access DB within C#?

this is what I tried:

string strDestDB2 = "NewMdb.mdb";
string strSourceConnect2 = "Data Source=" + strDestDB;
string strDestConnect2 = "Data Source=" + strDestDB2
+ ";Jet OLEDB:Password="+SAPassword;
jetEngine.CompactDatabase(strSourceConnect2,
strDestConnect2);

John

Jul 21 '05 #2
On Sun, 23 Nov 2003 08:56:45 -0800, "John K" <an*******@discussions.microsoft.com> wrote:

¤ ok,
¤ I'm lost at how to try this.... any pointers on
¤ how to set the password of an access DB within C#?
¤
¤ this is what I tried:
¤
¤ string strDestDB2 = "NewMdb.mdb";
¤ string strSourceConnect2 = "Data Source=" + strDestDB;
¤ string strDestConnect2 = "Data Source=" + strDestDB2
¤ + ";Jet OLEDB:Password="+SAPassword;
¤ jetEngine.CompactDatabase(strSourceConnect2,
¤ strDestConnect2);

If you want to set or change the password for an Access database you can use DDL (with Jet 4.0). See
the following example:

http://support.microsoft.com/default...b;en-us;304915
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: MLH | last post by:
Combo box LimitToList property setting of No does not prevent the MS Access error "The text you enter must match an entry in the list" from popping up. What makes this bad is that the error is not...
3
by: paulwilliamsonremove | last post by:
Hi, I have been manually setting up relationships in Access 2003. I received an error message when leaving a form that told me the record could not be saved because I had to have a related...
18
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
0
by: Edward Diener | last post by:
Since a __property can be split between a read access and a write access property in MC++, how does one set an attribute on a __property ? Is setting an attribute before either the read access...
1
by: simon | last post by:
I have an unbound RTF2 control in an Access 2003 form which I set to show either unformatted text or else text with words and sentences highlighted. I do this by setting the PlainText property,...
10
by: MLH | last post by:
I was wondering if setting object vars to Nothing near the end of a sub procedure was beneficial at all - since they (the OV's) are about to go out-a-scope anyway? For example, Sub MySub()...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
3
by: ApexData | last post by:
The editor eliminates spaces in my code. Is there a setting or technique for stopping this behavior. I want to be able to space out my code for cleaner reading? ' I Like This:...
0
by: iceborg | last post by:
Greetings, I have an application that was originally designed in Access 2000. It has been transformed to Access 2002 (XP), Access 2003, and now Access 2007. I have a form and subform, the...
4
by: joemo2003 | last post by:
Is there a way to use VBA check to see the macro security setting? I want to use VBA check to see is the "Trust access to VB project" setting is on? Such as it return "True" when set to Trust access...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.