473,387 Members | 1,742 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,387 software developers and data experts.

odbc

Hi.
I've got a "base.mdb" secured with "system.mdw". There's also a
password set on "base.mdb" . After configuration ODBC driver ( system
DSN ), supplying user and his pass too, when I try to connect do it I
receive error "Invalid password". What I'm doing wrong ? Is it related
to pass which is for "base.mdb" ? Regards.
Rick
Apr 5 '06 #1
9 2361
"Rysiek" <ri******@neostrada.pl> wrote in message
news:20*********************@vector.linux.vnet...
Hi.
I've got a "base.mdb" secured with "system.mdw". There's also a
password set on "base.mdb" . After configuration ODBC driver ( system
DSN ), supplying user and his pass too, when I try to connect do it I
receive error "Invalid password". What I'm doing wrong ? Is it related
to pass which is for "base.mdb" ? Regards.
Rick

A database password is a very basic form of security. If you have set up
security with an mdw file, then there is no point adding a database
password. It just complicates other things unnecessarily - so just remove
it.
Creating a dsn with odbc is not normally required either.

What are you trying to do?
Apr 5 '06 #2

A database password is a very basic form of security. If you have
set up security with an mdw file, then there is no point adding a
database password. It just complicates other things unnecessarily -
so just remove it. I can't remove it. I'm writing an application which is to get some data
from existing access database. I have no admin privileges on it, so I
can't do anything with it. I've got only user, password and database
password
Creating a dsn with odbc is not normally required either.

What are you trying to do?


My app it's some php scripts, and afaik only with ODBC I can connect do
*.mdb

Apr 5 '06 #3
"Rysiek" <ri******@neostrada.pl> wrote in message
news:20*********************@vector.linux.vnet...

A database password is a very basic form of security. If you have
set up security with an mdw file, then there is no point adding a
database password. It just complicates other things unnecessarily -
so just remove it.

I can't remove it. I'm writing an application which is to get some data
from existing access database. I have no admin privileges on it, so I
can't do anything with it. I've got only user, password and database
password
Creating a dsn with odbc is not normally required either.

What are you trying to do?


My app it's some php scripts, and afaik only with ODBC I can connect do
*.mdb

I'm afraid I don't know anything about php. Is this running on Windows? If
so, you should be able to use an ADO connection without needing any dsn
file.
But anyway, did you try removing the database password? (hopefully you
believe me that it should be removed)
Apr 5 '06 #4
O


I'm afraid I don't know anything about php. Is this running on
Windows? If so, you should be able to use an ADO connection without
needing any dsn file. As I don't know anything about access :) It's all done under
Windows. Anyway it seems not to be a problem with php. When I try for
example to compact database (on system DSN tab there's a option to do
this), I receive the same error.
Hmm, "ADO connection" could you in short describe this ?
But anyway, did you try removing the database password? (hopefully
you believe me that it should be removed)

Of course I believe, but I'm not allowed do this. I've got access to
this *.mdb file "as is".

Apr 5 '06 #5

"Rysiek" <ri******@neostrada.pl> wrote in message
news:20*********************@vector.linux.vnet...
O


I'm afraid I don't know anything about php. Is this running on
Windows? If so, you should be able to use an ADO connection without
needing any dsn file.

As I don't know anything about access :) It's all done under
Windows. Anyway it seems not to be a problem with php. When I try for
example to compact database (on system DSN tab there's a option to do
this), I receive the same error.
Hmm, "ADO connection" could you in short describe this ?
But anyway, did you try removing the database password? (hopefully
you believe me that it should be removed)

Of course I believe, but I'm not allowed do this. I've got access to
this *.mdb file "as is".

Dobrze.
If you are running Windows, you can create a plain text file with note pad
and cut and paste the code below. Change the username, passwords and file
locations, then close and save the file as TestMe.vbs and then run it by
double-clicking it.

This will verify that you really do have the right details. Once you have
done this test, you can move on to changing the code to do some useful work
with the database - such as reading or updating the data.

' **** Code Starts *******
Option Explicit

If TestDb()=0 Then
MsgBox "I can connect"
Else
MsgBox "I cannot connect"
End If
Function TestDb()

On Error Resume Next

Dim cnn
Dim strConn
Dim strSQL
Dim lngReturn

lngReturn=1

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\MyFolder\Database.mdb;" & _
"Jet OLEDB:System Database=C:\MyFolder\Workgroup.mdw;" & _
"User Id=MyLoginName;Password=MyPassword;" & _
"Jet OLEDB:Database Password=DatabasePassword;"

Set cnn = CreateObject("ADODB.Connection")

cnn.Open strConn

If Not cnn Is Nothing Then
If cnn.State > 0 Then
lngReturn=0
cnn.Close
End If
Set cnn = Nothing
End If

End Function
' **** Code Ends *******
Apr 5 '06 #6
I left out the last very important line in the function!!
Just before the End Function, you need TestDb=lngReturn
For clarity, the text is now:

' **** Code Starts *******
Option Explicit

If TestDb()=0 Then
MsgBox "I can connect"
Else
MsgBox "I cannot connect"
End If
Function TestDb()

On Error Resume Next

Dim cnn
Dim strConn
Dim strSQL
Dim lngReturn

lngReturn=1

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\MyFolder\Database.mdb;" & _
"Jet OLEDB:System Database=C:\MyFolder\Workgroup.mdw;" & _
"User Id=MyLoginName;Password=MyPassword;" & _
"Jet OLEDB:Database Password=DatabasePassword;"

Set cnn = CreateObject("ADODB.Connection")

cnn.Open strConn

If Not cnn Is Nothing Then
If cnn.State > 0 Then
lngReturn=0
cnn.Close
End If
Set cnn = Nothing
End If

TestDb=lngReturn

End Function
' **** Code Ends *******
Apr 5 '06 #7
O


Dobrze. :)
If you are running Windows, you can create a plain text file with
note pad and cut and paste the code below. Change the username,
passwords and file locations, then close and save the file as
TestMe.vbs and then run it by double-clicking it.

This will verify that you really do have the right details. Once you
have done this test, you can move on to changing the code to do some
useful work with the database - such as reading or updating the data.


Thank you for your support. I'll be able to test it on Saturday.
Rick

Apr 6 '06 #8
So, I've tried to test your func but it hasn't worked. After
running this i've got an error something like this "Improper character
at line 1, char 1". I've searched the web for solution for my problem
and found some infos that it's impossible to pass both passwords via
ODBC. So I decided to use other methods to access mdb file.
Thank you for your help
Rick
Apr 11 '06 #9
"Rysiek" <ri******@neostrada.pl> wrote in message
news:20*********************@vector.linux.vnet...
So, I've tried to test your func but it hasn't worked. After
running this i've got an error something like this "Improper character
at line 1, char 1". I've searched the web for solution for my problem
and found some infos that it's impossible to pass both passwords via
ODBC. So I decided to use other methods to access mdb file.
Thank you for your help
Rick

The file was tested on my machine - so it really does work. If you are
getting this error, it looks like the text has not been copied and pasted
properly.
Although I mentioned that having a username and password as well as a
database password is not a good idea, you can do it and you can write code
to connect to it. If you are happy with these other methods you mention
then OK, but if you need further help, just post back.
Apr 11 '06 #10

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

Similar topics

0
by: Marco Aschwanden | last post by:
Hi - Win2000 - Python 2.3.3 - py2exe 0.5.0 - eGenix Comercial & Base Package I am developing an app using mxODBC. On the home page they say ...
11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
0
by: Kong Li | last post by:
Follow up to this thread, the latest Oracle 9i release 2 patchset (9.2.0.5) fixed the handle count leak problem. The problem is in Oracle client component. Thanks. Kong ----- From: Kong...
6
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used...
4
by: Roger Redford | last post by:
Dear Experts, I'm attempting to marry a system to an Oracle 817 datbase. Oracle is my specialty, the back end mainly, so I don't know much about java or javascript. The system uses javascript...
4
by: Andreas Lauffer | last post by:
Can anyone tell me advantages / disadvantages of DataDirect Server Wire ODBC-driver? Any experiences? What about redistribution? Andreas Lauffer, easySoft. GmbH, Germany
3
by: Lauren Quantrell | last post by:
Maybe a dumb question - I'm new to ODBC. How do I install an Access ..mde file on a user's workstation and create the ODBC connection to the backend SQL Server database without having to go through...
5
by: Alec | last post by:
Hi All, I am currently trying to link in Access 97 to a table in a MSSQL 7 server. Initially the link is fine, however, when I close the access database and re-open it from the same network...
2
by: Crazy Cat | last post by:
Hi all, I am having trouble getting linked Oracle 9 server in MS SQL Server 2005 Express to work properly. My machine is running Windows XP. The Microsoft and Oracle OLE DB Providers have...
0
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.