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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Feeding data to Extra! from Ms Access

Status
Not open for further replies.

titleist0813

Programmer
May 19, 2005
2
US
I have been using the standard Open file for input method with a do while not eof() loop statment to automate some processing. I have been outputting info from access to a .csv file to do this. It would be a nice time saver if I could instead, link directly to the ms access database. I can succesfully link to the database in attachmate, but I have no idea where to go from there...

The code that I have been using is: (don't make fun of me too bad, I am self taught)

dim assoc as string
dim rfile as string
dim wfile as string

rfile = "C:\Documents and Settings\e04960\Desktop\Assoc.csv"
wfile = "c:\documents and settings\e04960\desktop\AssocStatus.csv"
close #1
Close #2
Open rfile For Input As #1
Open wfile for output as #2


' Loop until the end of file is reached.

Do While Not EOF(1)


dim status as string
dim test as string
dim level as string
dim cntrct_state as string
dim regflex as string
dim advflex as string

status = ""
' Read data into variables.
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)

Input #1, assoc

Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
sess0.screen.sendkeys assoc
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
sess0.screen.sendkeys "<enter><enter>"
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)

status = sess0.screen.getstring (09,19,01)
level = sess0.screen.getstring (04,09,33)
cntrct_state = sess0.screen.getstring (16,48,02)
regflex = sess0.screen.getstring (25,19,10)
advflex = sess0.screen.getstring (26,19,10)

print #2, assoc & ",", status & ",", level & ",",cntrct_state & ",",regflex & ",",advflex


loop

Sess0.Screen.WaitHostQuiet(g_HostSettleTime)

close #1
close #2


I would simply like to replace the open for input file with a statement to read from ms access

Any ideas would be greatly appreciated!!

 
You'll need to connect to the database.

Here is a FAQ that is close to what you need as it treats Excel as a database and "talks" to it.
How do I get data to Excel? faq99-4068

If you search on the web for info on using databases also.

calculus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top