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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A module is not a valid type

Status
Not open for further replies.

marn1997

Programmer
Aug 15, 2007
4
0
0
US
Public Sub testingStubForSqlStatement()
Dim strSql As String
Dim oSqlStatement As New SqlStatement
Dim rs As ADODB.Recordset

strSql = "SELECT unitspercase * casesperpallet FROM PRODUCTS WHERE PRODUCTCODE = ?1 " & _
" and messagename = ?2 and labelid = ?3"

With oSqlStatement
.Init strSql
.addParameter "044-10101", eStr
.addParameter "04410101", eStr
.addParameter "1", eInt
Set rs = .getDataSet()
End With
If hasRecords(rs) Then
Do While Not rs.EOF
Debug.Print (rs(0))
rs.MoveNext
Loop
End If
rs.Close

Set rs = Nothing
End Sub
 
Missing reference…?

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Is there a question, problem, error message, or comment? What is eStr?

Pleae use TGML Code tags to make your code easier to read.



Code:
Public Sub testingStubForSqlStatement()
    Dim strSql As String
    Dim oSqlStatement As New SqlStatement
    Dim rs As ADODB.Recordset

    strSql = "SELECT unitspercase * casesperpallet FROM PRODUCTS WHERE PRODUCTCODE = ?1 " & _
       " and messagename = ?2 and labelid = ?3"

    With oSqlStatement
       .Init strSql
       .addParameter "044-10101", eStr
       .addParameter "04410101", eStr
       .addParameter "1", eInt
       Set rs = .getDataSet()
    End With
    If hasRecords(rs) Then
       Do While Not rs.EOF
          Debug.Print (rs(0))
          rs.MoveNext
       Loop
    End If
    rs.Close

    Set rs = Nothing
End Sub






Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top