I am calling a dll which selects a value from a sql table. The MS script takes that value and puts it on form to select a specific item. It retrieves one value at a time.
Issue: I have 7 values in my table, the only values that get to the script are 2,4, and 6. I have throughly tested the dll and it seem to be working fine I get all of the value displayed when I add a message box. to the dll.
Here is the script dll code,
Dim strMyConn, strSQLString, strUpdateSql As String
Dim strPath As String
Dim count, docrsn As Integer
strMyConn = "Provider=SQLOLEDB;Data Source=iitdev1;Initial Catalog=visiflow;user id=sa;password="
strSQLString = "select top 1 doc_rsn from BMC_Document where A_ConvStatus ='P'"
Dim Conn As New ADODB.Connection
Dim Cmd As New ADODB.Command
Dim Rsl, Csl As New ADODB.Recordset
Conn.ConnectionString = strMyConn
Conn.Open
Set Rsl = Conn.Execute(strSQLString)
'Update status of selected records
strUpdateSql = "update bmc_document set a_convstatus='c' where doc_rsn='" & Rsl(0) & "'"
Conn.Execute (strUpdateSql)
GetDocRsn = Rsl(0)
Rsl.Close
Conn.Close
*****Here is the MS code
public obj As Object
public nValue as integer
VBStart
Function DocRsn
set obj=createobject("conversiondll.class1")
obj.getdocrsn
docrsn=obj.getdocrsn
set obj=nothing
End function
VBEND
VBEval>docrsn,nValue
messagemodal>%nValue%
Any help would be appreciated
Thanks
Earl
Losing data from dll
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
My first thought was that you had perhaps nested a counter and was doing a double count, getting every other record. But I see nothing like that in the code you show.
Just a thought, but have you looked as the database source with respect to the "where" clause in your sequel string? Is it possible that every other record has a "P"?
strSQLString = "select top 1 doc_rsn from BMC_Document where A_ConvStatus ='P'"
Just a thought, but have you looked as the database source with respect to the "where" clause in your sequel string? Is it possible that every other record has a "P"?
strSQLString = "select top 1 doc_rsn from BMC_Document where A_ConvStatus ='P'"
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!