|
|
I want to make a Connection to a Password protected Access 2003 Database.
I tried to make a "Data Connection" in "Server Explorer" tab. In the "Data link properties" dialog box, I select "Microsoft Jet 4.0 OLE DB Provider" in the Provider tab, and in the Connection tab, I select my Database location and default checked "Blank Password" with username "Admin" (Default). It works fine if the Database has no password set.
But when I set password on Database and unchecked "Blank Password" and enter my password in the field "Password" and then click on "Test Connection", it failed to make a connection to Database.
Please help me solve this problem.
Also i have to give a complete location of database, is there any way to give the location of database to the same of executable, e.g. in the Bin folder both files (Database and MyProgram.exe) present, it automatically collect the location of executable file.
Iftikhar Ali
|
|
|
|
|
Select ”Microsoft Jet 4.0 OLE DB Provider”
Select your database location
Do not change anything.
Select “All” tab
Select “Jet OLEDB:Database Password”
Type your password.
Click OK.
chatura
|
|
|
|
|
I have to change/apply password to Access database by opening it in Exclusive mode and then change/apply password to it.
I then close database file and close Access, and even I restarted my computer and try your instructions but on Test Connection got this error.
"Test connection failed because of an error in initializing provider. Cannot start your application. The workgroup information file is missing or opened exclusively by another user."
I did the same process as you describe before asking this question, but the error above mentioned occured.
So, tell me now what should I do.
|
|
|
|
|
I do not know what your error is, but it worked when I did so. I will try to find it. Try to do kostasdiktia2's example.
chatura
|
|
|
|
|
Nonetheless, thanks.
I'll try kostasdiktia2's example.
|
|
|
|
|
temp = System.IO.Path.GetFullPath("Data.mdb")
temp = "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=" & temp & ";Mode=ReadWrite;Extended Properties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="####";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False"
OleDbConnection1.ConnectionString = temp
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
This is an example with a database from data.mdb file (Access file)!
First, I put in temp the path.
Next, I put in temp the connection string of database (in field #### you must write the password)
*I am not 100% sure if it wants password there or in first line! Make combinations!
And finally, I change the connecion string of my OledbConnection..
-- modified at 19:16 Monday 6th February, 2006
|
|
|
|
|
I'll try your solution.
At this moment, I'm building my software without database password. I'll try your solution and then inform you. While please tell me, in your solution, you use Password string many times and in the end advice me to enter my password in place of ####, tell me I only have to enter password in place of #### or everywhere you use Password.
|
|
|
|
|
Look..
I am not sure 100%,that I told you..so, make some combinations for the "where", but you can find informations for this in Web..Sorry for my incomplete help..but i dont want make mistakes and make difficult your job..
Friendly..
|
|
|
|
|
OK I'll try different combinations.
Tell me how this line of code will work.
temp = System.IO.Path.GetFullPath("Data.mdb")
What I understand is this:
>>First you declare temp as string
Now tell me how VB.NET knows where is Data.mdb, I mean did you include it in project as something & if you did tell me how? All steps in detail please of the above line.
|
|
|
|
|
Ok listen...
First of all:
Imports System.IO 'on the top of your code
Dim temp as string 'in your code
Next step, is to add the .mdb file (Access file) (for example Data.mdb) to your project! Because in the future, you may built a setup to install this program in other computers, its good this file have the path of your .exe, so you must add it in C:\...\EXAMPLEPROJECT\bin if you have Visual Studio 7 or in C:\...\EXAMPLEPROJECT\bin\Debug\ if you have Visual Studio 8!
So this code line [temp = System.IO.Path.GetFullPath("Data.mdb")] take the path of your .exe and add in the end of this string the "\Data.mdb"..so you have the path of your Access file, which now is in folder with your .exe!
If you have more questions..tell me...
I hope I help you... ;)
-- modified at 16:26 Friday 10th February, 2006
|
|
|
|
|
Thanx a lot.
Sorry for late reply.
|
|
|
|
|
I am using SQL Server 2000 as my DB and 2003 is my Dev environment. I wanted to know is there any method by which I can get number of parameters in any give Stored procedure.
-Krishnaraj
|
|
|
|
|
I am not expert, so I don't know exectly but I'll tell you that I think. Ok?
If you use
exec sp_helptext 'StoredProcedureName'
you'll get the Text . Using that text you can count your parameter. Have a nice job.
!alien!
|
|
|
|
|
There is a better way than the one already suggested.
SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
WHERE SPECIFIC_NAME='StoredProcedureName'
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Thank you, it’s a great information.
But earlier I did it with the below code. Can you make any suggestion on this. My actual intention was to check whether particular column exists in sp’s parameter list.
Declare @Id as numeric
Select @Id = id from sysobjects where name like '%SP_Name%'
Select * from syscolumns where name like 'Column_Name' and Id =@id
Krishnaraj
|
|
|
|
|
That sould be more efficient if you did WHERE name = 'SP_Name'
Let's say you have a two stored procedures called GetData and GetDataForUser . You want to find the number of parameters for GetData . Using the code you supplied you can't tell if it will return the parameters for GetData or GetDataForUser because you gave it wild cards which say that you are looking for a procedure with GetData somewhere in the name.
I would suggest that the INFORMATION_SCHEMA.PARAMETERS way is easier to work with. If you examine the properties of the view itself, you'll see that it is just using sysobjects and syscolumns as well.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Yes, you are right, I just checked by running both queries simultaneously and I found that the code you have suggested executed faster then mine.
Thanks a lot…..
Krishnaraj
|
|
|
|
|
Thank you very much.
Your code is also helpful to me.
!alien!
|
|
|
|
|
Hi!
When I change connectionstring(server changes)in run time my crystal report does not work and I neet to change in crystal report in design time. I want to fix it. How do I fix it.
If possiable,Please give me two example.
One for SQL Server Authentication and another for Windows Authentication.
Please someone help me.
!Thank!
!alien!
|
|
|
|
|
i had the same problem but u can connect using ODBC and from ODBC u can change the path or the link to the dataBase
|
|
|
|
|
Do we have any key word or special word "ADMINISTRATOR" in VB6.0
|
|
|
|
|
No, why?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I have created a new font file. I want change the font in the title bar with that font, but I do not like to change Display Properties or create a custom title bar. How can I do this
Please help me
Thank you,
chatura
|
|
|
|
|
You can't. Those are the only two options you have.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|