The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum. |
connection question |
Post Reply |
Author | |
wdavidhicks
Newbie Joined: June 01 2004 Location: United States Status: Offline Points: 32 |
Post Options
Thanks(0)
Posted: August 04 2004 at 11:59am |
I'm running D3 7.3.4.NT. Users are Accuterm 2K2 5.1c.
I've taken advantage of D3's odbc class library and integrated several applications that work with our b-trieve and SQL databases. These applications are MS Access apps that run on a schedule from the SQL server. For the Accuterm users I've incorporated scripts that will automatically send emails, launch dialog boxes to receive input because it's easier than recoding for screen draws, one that invokes a DDE exchange to a software package for address verification and some others. What I haven't tried to do is connect to a SQL database from within the Accuterm/Pick environment. I can create another scheduled MS Access app that would populate a Pick file with SQL data but I kinda need something more real time. From within Accuterm I need to authenticate user's input from records that reside in a SQL database. This is do-able, right?? |
|
Dave Hicks
|
|
jgold
Moderator Group Moderator Joined: December 29 2003 Location: United States Status: Offline Points: 48 |
Post Options
Thanks(0)
|
Hi Dave,
There are a lot of ways to do it. Here's an example that uses ADO to connect to an SQL Database. You'll need to replace the stuff with the ***asterisks*** with values specific to your situation; Sub Main() 'Some ADODB constants Const adOpenStatic = 3 Const adLockReadOnly = 1 'Create the database connection Set Connection = CreateObject("ADODB.Connection") 'Create a connection string and try to open a connection With Connection .connectionstring = "driver={SQL Server}" _ & ";server=**Server Name Goes Here***" _ & ";uid=***SQL Login ID goes here***" _ & ";pwd=***Password Goes Here***" _ & ";database=***Name of the database goes here***" .Open End With 'Create a recordset object Set Recordset = CreateObject("ADODB.Recordset") 'Open the recordset by passing an sql statement Recordset.Open("Select * from somefile", Connection, adOpenStatic, adLockReadOnly) While Recordset.EOF = False Value = Recordset!SomeFieldName recordset.Movenext Wend Set Recordset = Nothing Connection.Close Set Connection = Nothing End Sub |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |