passing variables

Results 1 to 2 of 2

Thread: passing variables

  1. #1
    Gary Dunne Guest

    Default passing variables

    Trying to call a method that saves some data to a Db. All other similar method calls work fine. Constantly getting "Type Mismatch" - the Err.Source is always "Microsoft VBScript runtime error". The call works fine if called from VB using procatically the same code.<BR><BR>Dim oCustomer &#039 Single customer<BR>Dim ocCustomers &#039 Collection of customers<BR><BR>Set oCustomer = ocCustomers.FindCustomer(ByCustomerId,lReference)< BR>&#039 All above works fine<BR><BR>oCustomer.Prop1 = sSomevalue<BR>oCustomer.Prop2 = sSomevalue2<BR><BR>Set oCustomer = ocCustomers.Save(oCustomer)<BR>&#039 Above should save the object data and return a modified customer object....BUTR ALL I GET IS Error 13<BR><BR>Is there a problem with the number of arguments that can be passed ? or a data type conversion problem maybe ???<BR><BR>HELP !!!!!!<BR><BR>THANKS<BR><BR><BR><BR><BR><BR><BR><B R><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: passing variables

    I should imagine you&#039ve sorted your problem but if not I usually find that trimming the value and then converting it, using for example cstr, cint, etc.. works quite nicely.<BR>Another trick is to use the VB vartype function to ascertain the datatype of the variable and then compare that with the expected datatype.<BR>If you&#039re still stuck let me know exactly which line of code is causing the error and the datatype that the database is expecting for that field.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts