ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ODBC connection trough Visual Basic in Excel 2003 (https://www.excelbanter.com/excel-programming/406333-odbc-connection-trough-visual-basic-excel-2003-a.html)

Cato Larsen

ODBC connection trough Visual Basic in Excel 2003
 
Hey guys!
I've searched the forum a bit for an answer to this, but none of the
questions asked so far would give an answer to my question. So here goes!

How do you connect to a database, in this case REMEDY trough an AR Ssytem
ODBC Data Source, query the database for a table and grab everything in the
selected columns from X date to Y date into a defined worksheet?

It's setup in the ODBC sourceadmin with the following info:

Data Source Name: AR System ODBC Data Source
AR Server: REMEDY
Username: myUsername
Password: (blank)

Options: Replace '.' in object names is checked.


The table that should be queried for the info is called "HDQueries" and only
10 of the columns in the table are needed, the sheets name is "DataDump" and
the insert will start at A1 and go on til it's done.

One of the issues I'm having is that I can't store my username and password
in the code. A dialog of sorts must pop-up with a request for a valid
username and password for the connection. The second is that I'm a bit over
my head on how to program this. ^_^ I have rudamentary VB skills, so if
someone can help me trough this, the rest should be somewhat easier. :)

All help are welcome!
--
Cato Larsen
HelpDesk Monkey


All times are GMT +1. The time now is 05:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com