Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > Advanced Features
  New Posts New Posts RSS Feed - connection question
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum Lockedconnection question

 Post Reply Post Reply
Author
Message
wdavidhicks View Drop Down
Newbie
Newbie


Joined: June 01 2004
Location: United States
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote wdavidhicks Quote  Post ReplyReply Direct Link To This Post Topic: connection question
    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
Back to Top
jgold View Drop Down
Moderator Group
Moderator Group

Moderator

Joined: December 29 2003
Location: United States
Status: Offline
Points: 48
Post Options Post Options   Thanks (0) Thanks(0)   Quote jgold Quote  Post ReplyReply Direct Link To This Post Posted: August 09 2004 at 6:29am
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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.