Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA MySQL .NET connector

Status
Not open for further replies.

Dustman

Programmer
May 7, 2001
320
US
I've used the .net connector for MySQL before with VB .net.. but it doesn't seem to work with VBA. Anybody know if this is true? I'm trying to connect with Outlook 2003 VBA.

-Dustin
Rom 8:28
 
I've done it before with ODBC.. isn't that the same thing? I love the ability of the .net connect because all i have to do is build my sql statement and go.. I really didn't want to have to create a DSN or anything.

-Dustin
Rom 8:28
 

Something like this...
Code:
    Dim sConn As String, sSQL As String, sServer As String
    Dim rst As ADODB.Recordset, cnn As ADODB.Connection
    
    Set cnn = New ADODB.Connection
    
    sServer = "DWPROD"
    cnn.Open "Driver={Microsoft ODBC for Oracle};" & _
               "Server=" & sServer & ";" & _
               "Uid=;" & _
               "Pwd="
    
    Set rst = New ADODB.Recordset
    
    sSQL = "SELECT Sum(A.STKITQTY_233+A.STKOHQTY_233+A.QTYONDOK_233) AS Inv_Qty "
    sSQL = sSQL & "FROM FRH_MRP.PSK02233 A "
    sSQL = sSQL & "Where A.PARTNO_201='" & Trim(sPN) & "' "
    sSQL = sSQL & "  And STORETYP_233<>'W' "
    
    rst.Open sSQL, cnn, adOpenStatic, adLockReadOnly, adCmdText
.....


Skip,

[glasses] [red][/red]
[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top