[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Accessing ODBC via an Agent

Posted on 2004-03-22
4
Medium Priority
?
412 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
ID: 10652331
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
ID: 10652354
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
ID: 10652360
FYI, Partha's *LSXODBC is the same as LS:DO.
0
 
LVL 19

Accepted Solution

by:
RanjeetRain earned 2000 total points
ID: 10655803
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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

830 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