Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access DBase/ User Name & Password?

Status
Not open for further replies.

cyprus106

Programmer
Apr 30, 2001
654
I'm using the Data Access TTable, TDatabase and TDataSource components to access a Microsoft Access DBase. I used the Data Sources (ODBC ) app and added a new User DSN to connect to and I left the user name and password blank when creating it.

When I activate the TTable it still asks me for that login screen. How can I avoid that? I don't want to see the login screen. I know in TDatabase it has an option but not in TTable. Cyprus
 
When starting ms-access the default user is admin.
I guess you have to log in with user name "admin" and leave the password blank.
 
Look into the use of the TDatabase component.
For example, say you had a TDatabase Componet called Database1.

This code would help. (check the borland help files)

Database1->Params->Add("PASSWORD=");
Database1->LoginPrompt = false;
 
well, my probmen is that I don't have to log on at all. The name and password are blank so when the login screen comes up all I ever have to do is press enter. I'm making this to sell coppercially and I can't have that stupid login screen popping up every time, especially when all you ever have to do is press enter.

The login prompt is coming from the TTable component. Cyprus
 
the help I previousley gave you will solve this problem
 
It didn't work. I put all of that in but when I activated the TTable component it still asked me for a password. I left it blank and it accepted that. I don't ever have to put anything into the name and password wen I sign on. All I have to do is push enter. This isn't good. If I can just leave it blank why does it come up at all? I want it to not prompt anymore. this is happening on the table, not the database, by the way. Cyprus
 
1.Put a TDatabase component on the form
2.Set the database name and alias in the Tdatabase object inspector
3. in the params editor of the Tdatabase object inspector put type: PASSWORD =
4.Change loginprompt to false.
5.set the TransIsolation property, I use trDirtyRead
6.Set the keep connection property, I use true
7. In run time set the connected property to true on your applications main form oncreate().
8.In the OnLogin event of your Tdabase type the following code, assuming your Tdatabase is called Database1
Database1->Params->Add("PASSWORD=");
Database1->LoginPrompt = false;
9.Good luck
 
ok, now the TDatabase component doesn't ask me to log on... but the TTable does. I'm connecting a TTable after it and when i do it still prompts me for a password and I can't find ANY way around this one Cyprus
 
I have a question.

is the "Microsoft Access DBase" a plain jane
dbase file or does it have attributes that require
a logon

tomcruz.net
 
nope. It doesn't require a logon. It's just normal. I can stop the logon screen when I fire up the TDatabase component and work just fine, but when I activate the TTable component it tries to give me the logon screen. And there's no propoerty orr parameters to turn this one off. Cyprus
 
Get rid of the TDatabase, leave the database name empty in the TTable, chdir to the directory the table is in, open table. I havent used TDatabase so I cant say much other than you probably need it if you are accessing a server.
otherwise if its a local file just keep it simple. I generally leave the alias names in the dabasename empty because I am not interested in going through a server.
Translated that means I probably couldnt at this point code for server access anyway. And I have had problems with logins before so I got rid of them for now.

I would be curious as to why you are using TDatabase.

thanks for the info.

tomcruz.net
 
Message for cyprus106
I have the same problem you had with the username and password that TTable require for the ACCESS db. Did you manage to resolve it and if so can you tell me how?

Thanks
Deyzel
 
from borland help for tha Database component do the follwoing:

Supply the login information from the application, before the attempt to login. Assign values to the USER NAME and PASSWORD parameters of the database component through its Params property. Set the LoginPrompt to false, to prevent the default login dialog from appearing. The values in the Params property may be set at design-time through the Object Inspector or programmatically at runtime. For example:

Database1->Params->Add("USER NAME=");
Database1->Params->Add("PASSWORD=");
Database1->LoginPrompt = false;
Database1->Connected = true;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top