Jump to content

server 2003 help


Recommended Posts

i have a script that reads from and writes to an access database. All of the files are located on a server 2003 server. It works fantastically in XP, but i wanted to be able to run it from the server via remote desktop.

The script is not failing or giving me any errors, but its also not pulling the info or populating the lists (not sure where its failing)

code to fill lists and get fields for later input:

;~ fill lists
$query = "SELECT * FROM " & $tares
global $tareoutput=_listdata($query, $db, $taredesc, $tareW)

for $i=1 to $tareoutput[0][0]
    $strData = $strData & "|" & $tareoutput[$i][0]
Next

for $i=1 to 21
GUICtrlSetData($Combo[$i],$strData)
Next

global $fields = _FieldNames($db, $wastetable)

functions:

func _listdata($_sql, $_dbname, $_field, $_field2)
$adoCon = ObjCreate ("ADODB.Connection")
    $adoCon.Open ("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $_dbname)
    $adoRs = ObjCreate ("ADODB.Recordset")
    $adoRs.CursorType = 1
    $adoRs.LockType = 3
    $adoRs.Open ($_sql, $adoCon)
    $_count=$adoRs.RecordCount
    Global $_output[$_count+1][2]
    $_output[0][0]=$_count
    $r=0
    
    With $adoRs
        If .RecordCount Then
            While Not .EOF
                $r=$r+1
                $_output[$r][0]= .Fields ($_field).Value
                $_output[$r][1]= .Fields ($_field2).Value
                .MoveNext
            WEnd
        EndIf
    EndWith
    return $_output
    $adoCon.Close
EndFunc

Func _FieldNames($dbname, $tblname)
    $adoCon = ObjCreate ("ADODB.Connection")
    $adoCon.Open ("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $dbname)
    $adoRs = ObjCreate ("ADODB.Recordset")
    $adoRs.Open ("SELECT * FROM " & $tblname, $adoCon)
    dim $name[$adoRs.Fields.Count-1]
    $name[0]=$adoRs.Fields.Count-2
    For $i = 1 To $adoRs.Fields.Count-2
        $name[$i] = $adoRs.Fields ($i +1).Name
    Next
    Return $name
EndFunc ;==>_FieldNames

Ive tried searching the forms and have not been able to come up with anything definative. Thanks for any suggestions you can give.

Link to comment
Share on other sites

maybe adding some debug information (msgboxes along that way) to see where the two programs start to have descrepencies form eachotehr when ran of differrent servers.

I also saw this on a wuick google search but maybe it's just some junk-

http://sleepyhead81.blogspot.com/2005/09/p...nection-in.html

seems to say there's a problem with ADODB in 2003? I doubt it but worth a mention. I'd try some debugging first on your end.

Link to comment
Share on other sites

i tracked it down some more and everything works just fine up until

for $i=1 to 21
GUICtrlSetData($Combo[$i],$strData)
Next

for some reason it is not populating any of my lists. I tried

GUICtrlSetData($Combo[1],"|1|2|3|4")

and it still did not work. Anybody else have a problem with ctrlsetdata? Is there another way to do this?

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...