Hello all. I have code that I use to fill a dataset and then loop through it. This is an ODBC Database connection to an Advantage database that I had to use ODBC for. The code I have to do the fill is:
Dim strConn As String = "DSN=CSTEST"
Dim objConn As New Odbc.OdbcConnection(strConn)
Dim objCmd As New Odbc.OdbcCommand
Dim objDA As New Odbc.OdbcDataAdapter
strSQL = "SELECT PAYMENT.co_code, count(PAYMENT.Qual_no) AS NEWENROLLEES " & _
"FROM CO_MAST RIGHT JOIN PAYMENT ON CO_MAST.CO_CODE = PAYMENT.CO_CODE " & _
"WHERE CO_MAST.CO_STATUS = True " & _
"GROUP BY co_code"
objDA = New Odbc.OdbcDataAdapter(strSQL, objConn)
objDA2.Fill(ds2, "PAYMENT"
HOW DO I JUST EXECUTE A QUERY LIKE THIS:
strSQL = ""
strSQL = "SELECT DISTINCT co_code, Qual_no, min(paid_date) As PaidDate " & _
"INTO TMPPAIDDATES FROM PAYMENT " & _
"GROUP BY co_code, Qual_no"
Dim strConn As String = "DSN=CSTEST"
Dim objConn As New Odbc.OdbcConnection(strConn)
Dim objCmd As New Odbc.OdbcCommand
Dim objDA As New Odbc.OdbcDataAdapter
strSQL = "SELECT PAYMENT.co_code, count(PAYMENT.Qual_no) AS NEWENROLLEES " & _
"FROM CO_MAST RIGHT JOIN PAYMENT ON CO_MAST.CO_CODE = PAYMENT.CO_CODE " & _
"WHERE CO_MAST.CO_STATUS = True " & _
"GROUP BY co_code"
objDA = New Odbc.OdbcDataAdapter(strSQL, objConn)
objDA2.Fill(ds2, "PAYMENT"
HOW DO I JUST EXECUTE A QUERY LIKE THIS:
strSQL = ""
strSQL = "SELECT DISTINCT co_code, Qual_no, min(paid_date) As PaidDate " & _
"INTO TMPPAIDDATES FROM PAYMENT " & _
"GROUP BY co_code, Qual_no"