×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Extra connectivity to a SQL or MySQL database

Extra connectivity to a SQL or MySQL database

Extra connectivity to a SQL or MySQL database

(OP)
Does anyone have any examples or documentation on getting extra to connect to a SQL or MySQL database, including how to add, update, and move through the records?

RE: Extra connectivity to a SQL or MySQL database




Hi,

Extra cannot connect.  But you can write VBA code, using ADO to access you database.

this happens to be a function I wrote to return a value, but the principle is the same.  You just need a library reference to Microsoft ActiveX Data Object n.m Library

CODE

Function GetPartPriorty( _
        sPN As String) As String
'--------------------------------------------------
'SkipVought
'2007-08-02
'--------------------------------------------------
' Access: DB2.SFCS.READ
'--------------------------------------------------
':this function returns PRIPART for a given Part Number
'--------------------------------------------------

    Dim sConn As String, sSQL As String, sServer As String
    Dim rst As ADODB.Recordset, cnn As ADODB.Connection
    Dim lLineCtrl
    
    Set cnn = New ADODB.Connection
    
    sServer = "DB2OLEDB"
                 
    cnn.Open "Provider=MSDASQL.1;Persist Security Info=False;" & _
                "User ID=;" & _
                "Extended Properties=""DSN=Shadow Direct DB2P 32-bit;" & _
                "UID=;PORT=6800;HOST=mvsb1;SUBSYS=DB2P;CPFX=SHADOW;AT=YES;" & _
                "DP=%;AF=YES;MXBU=40960;AUST=NO;CNTM=120;"""

    
    Set rst = New ADODB.Recordset
    
'    sSQL = "SELECT Qty, Current_Op, Location, sf_cc, sf_oper, mach_grp "
    
    sSQL = "SELECT PRIPART "

    sSQL = sSQL & "FROM CAP.T_PART_NUMBER "
    
    sSQL = sSQL & "WHERE (PARTNO='" & Trim(sPN) & "')"
    
    rst.Open sSQL, cnn, adOpenStatic, adLockReadOnly, adCmdText
                          
    rst.MoveFirst
    
    
    If rst(0) <> "" Then
        GetPartPriorty = rst(0)
    End If

    rst.Close
    cnn.Close
    
    Set rst = Nothing
    Set cnn = Nothing
End Function
 

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close