Linker IT Software
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
Automate Login into Database once Excel Opens (Read 8312 times)
YaBB Newbies


Posts: 1
Automate Login into Database once Excel Opens
09.10.08 at 14:27:11
Hi Mr.,
   we have recently bought license for SQl XL QUERY SOFTWARE and wanted to use it for reporting need of our users, however we do not want them to enter or know the password of Database user. please give us a macro or an VB code via which we can put it once in the sheet and everytime we open excel connection gets initialized automatically.
warm regards
Abdul Rahman
Gerab Group
Back to top
Email   IP Logged
Gerrit-Jan Linker
YaBB Administrator

Posts: 75
Re: Automate Login into Database once Excel Opens
Reply #1 - 09.10.08 at 19:20:17
I can give you the code but it is likely that specific setting are needed for your connection. It is really much easier if you do this yourself. Did you know SQL*XL supports macro recording? You can just record logging onto the database and generate the code that is needed. Just follow these steps:
1. Open a new .xls
2. Tools -> Macros -> New macro (accept all default settings)
3. Connect to the database using SQL*XL
4. Stop the macro recorder
5. Save the .xls and call it e.g. login.xls
Now you have hard coded the username and password into the macro. To change the user and password, open login.xls and go to the visual basic editor (Alt-F11). In module1 you will find your macro. It is just a few lines you will be able to spot the username and pasword you used. You can edit the macro if you wish.
You probably want to have a button to start the macro on a toolbar. Please read the last point from the next topic to read how to do this:
If you need further help please let me know.
Back to top

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1