Accessing Business Objects with a Client side script?

Hello, 

I have a script complete that runs a SQL Query and returns the results back in a MsgBox. The very last part I need to do is access the Sales Order Number to include this in my "Where" clause for my Query. 

This needs to be run on the Client side from what I understand. However, it seems I am not allowed to use any business object handle, as whether i use oBusObj, oSession, etc, I recieve an error along the lines of "Object required: oBusObj"

I have also tried to select the variables to be used under "link settings", but even then if I try to reference the variable in my script I receive the error "Invalid Character". 

Any ideas? I have been working on this project for quite some time and would hate to have to scratch it because I'm missing something. 

Thanks,