Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


SQL Error in VB: Invalid use of null

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,61755
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> SQL Error in VB: Invalid use of null
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 SQL Error in VB: Invalid use of null - 6/23/2008 5:42:35 PM   
  chaya

 

Posts: 12
Score: 0
Joined: 6/16/2008
Status: offline
Hi All

Iam trying to retrieve values from database when iam issued "Invalid use of null" error.
But this field holds a value.

This is the piece of code where the error occurs:
.
.
MsgBox SmObject.Data.Value("TDMX_RELATED_PART_ID") 
.
.

Please guide me through this.
 
 
Post #: 1
 
 RE: SQL Error in VB: Invalid use of null - 6/23/2008 10:34:11 PM   
  ninjamaster

 

Posts: 107
Score: 0
Joined: 1/23/2007
Status: offline
Are you requesting the correct type of value.

Have you maybe declared it somewhere as an interger and the value held is text?

Just a thought

(in reply to chaya)
 
 
Post #: 2
 
 RE: SQL Error in VB: Invalid use of null - 6/24/2008 4:38:59 PM   
  chaya

 

Posts: 12
Score: 0
Joined: 6/16/2008
Status: offline
I did check with it earlier.
Its a char field. Iam retrieving it as a string

(in reply to ninjamaster)
 
 
Post #: 3
 
 RE: SQL Error in VB: Invalid use of null - 6/24/2008 9:13:29 PM   
  ehvbs

 

Posts: 2201
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi chaya,

I think your problem is caused by your query not returning the data you think
it should. Did you test with IsNull()?

Regards

ehvbs

(in reply to chaya)
 
 
Post #: 4
 
 RE: SQL Error in VB: Invalid use of null - 6/24/2008 9:30:37 PM   
  chaya

 

Posts: 12
Score: 0
Joined: 6/16/2008
Status: offline
Yes, i did it check it with IsNull(). Its returning Null.
But the database field is not having a null value. It holds a value.

(in reply to ehvbs)
 
 
Post #: 5
 
 RE: SQL Error in VB: Invalid use of null - 6/24/2008 9:52:01 PM   
  ehvbs

 

Posts: 2201
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi chaya,

please show your SQL/code.

Thanks

ehvbs

(in reply to chaya)
 
 
Post #: 6
 
 RE: SQL Error in VB: Invalid use of null - 6/25/2008 10:26:36 PM   
  chaya

 

Posts: 12
Score: 0
Joined: 6/16/2008
Status: offline
This is a SmarTeam Script 

  Set SmRec = Record1.GetRecord(0)
   Set SmObject = SmSession.ObjectStore.ObjectFromData(SmRec,True) 

    *  MsgBox  SmObject.Data.Value("TDMX_RELATED_PART_ID")

Error is given in the last line *

(in reply to ehvbs)
 
 
Post #: 7
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> SQL Error in VB: Invalid use of null Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts