Solved

dao 3.6, VBA, and iSeries Access ODBC driver

Posted on 2011-02-17
2
1,567 Views
Last Modified: 2012-05-11
Hi,
how to connect a recordet using dao 3.6
to a odbc machine?
I have already the connection string
Dim connStr As String
   connStr = "Driver={iSeries Access ODBC Driver};System=clientaccess;Uid=XXX;Pwd=yyy;"

but I dont know how to connect a database and so a recordset to a specific table on this position,
using dao 3.6 and vba in excel

thanks
0
Comment
Question by:bobdylan75
  • 2
2 Comments
 

Accepted Solution

by:
bobdylan75 earned 0 total points
ID: 34917140
Sorry
resolved by ADODB
Public Const pathdocs = "c:\docs"
Public cwI5Servent As New ADODB.Connection

Sub create_docs()

    
    Dim FORNIT As New ADODB.Recordset
    cwI5Servent.CursorLocation = ADODB.CursorLocationEnum.adUseClient
    Dim connStr As String
    connStr = "Driver={iSeries Access ODBC Driver};System=192.168.54.200;DATABASE=QS36F;Uid=pcs;Pwd=pcs;"
    cwI5Servent.Open (connStr)
    
    Set FORNIT = cwI5Servent.Execute("SELECT * FROM QS36F.DDSG001")
    
    FORNIT.MoveFirst
    While Not FORNIT.EOF
        MsgBox FORNIT.Fields("gcdrag").Value
        FORNIT.MoveNext
    Wend
    
    FORNIT.Close
    'Dim O As Object
    'O = fornitori.Open("SELECT * FROM QS36F.DDSG001", cwI5Servent, adOpenStatic, adLockOptimistic)

    cwI5Servent.Close

End Sub

Open in new window

0
 

Author Closing Comment

by:bobdylan75
ID: 34917149
Sorry I resolved by myself
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

685 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