Solved

Accessing ODBC via an Agent

Posted on 2004-03-22
4
400 Views
Last Modified: 2013-12-18
Hi Guys

Can Notes initiate an Agent the will open a ODBC coonction to Access under certain circumsatances and exchange data

I have a link,Using File-Get External Data-Link  in Access

0
Comment
Question by:adspmo
  • 2
4 Comments
 
LVL 14

Expert Comment

by:p_partha
Comment Utility
Here is a preliminary code

Put this in ur options:

Uselsx "*LSXODBC"




Dim con As New ODBCConnection
Dim qry As New ODBCQuery
Dim result As New ODBCResultSet
' Connect to the datasource
If Not con.ConnectTo("OurODBCSource") Then ' here give your odbc name
Messagebox "Could not connect ",, "Error connecting"
Exit Sub
End If
' Set up the odbc objects
Set qry.Connection = con
Set result.Query = qry

qry.SQL = "SELECT * FROM <your tablename>"


' and execute the query - and wait for the result set to fill up with data
result.Execute

' Now roll through each row of the result set and create a new document in our database for each row in the table
If result.IsResultSetAvailable Then
Do
result.NextRow

msgbox result.getvalue("name")
Loop Until result.IsEndOfData
result.Close(DB_CLOSE)

End If

' Close the connection to the ODBC Source
con.Disconnect



Partha
0
 
LVL 31

Expert Comment

by:qwaletee
Comment Utility
Yes, Notes can.  Agents can use LCLSX (better but harder) or LS:DO (easier but less flexible). Define a system DSN, then connect to it using either of the above.
0
 
LVL 31

Expert Comment

by:qwaletee
Comment Utility
FYI, Partha's *LSXODBC is the same as LS:DO.
0
 
LVL 19

Accepted Solution

by:
RanjeetRain earned 500 total points
Comment Utility
Hi adspmo,

Check out this class http://www13.brinkster.com/ranjeetrain/source/gware/clsodbc.asp I wrote it to do something similar. This code is tested ok agains a sybase database.

Yes, on the machine where the code will run, you need a system DSN. That's a requirement.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now