Sure, this is just a ""dumbed down"" version i quickly created to try to get to the bottom of the issue. I usually use a connection string more like the one that is commented out. The other one is copied directly from the ODBC connection test window.
dim conn, rs, sql, discount, linedisc, strCustNo, strVendNo, strAltDiv, strCustDiv
strCustDiv = ""01""
strcustNo = ""0000010""
set conn = CreateObject(""ADODB.Connection"")
'conn.open = ""DSN=SOTAMAS90;UID=NEO;PWD=;Directory=\\server02\e$\Sage\Version45\MAS90;Company=RCI;Cachesize=4;DirtyReads=1;BurstMode=1;SERVER=NotTheServer""
conn.open = ""DSN=SOTAMAS90; Directory=E:\MAS90; Prefix=E:\MAS90\SY\, E:\MAS90\==\; ViewDLL=E:\MAS90\HOME; LogFile=\PVXODBC.LOG; CacheSize=4; DirtyReads=1; BurstMode=1; StripTrailingSpaces=1; SERVER=NotTheServer""
sql = ""select * from AR_Customer where ARDivisionNo = '"" & strCustDiv & ""' and CustomerNo='"" & strcustno & ""'""
set rs = Conn.Execute(sql)
if not (rs.bof and rs.eof) then
msgbox rs(""CustomerDiscountRate"")
else
msgbox ""Nothing""
end if