Wrox Programmer Forums
|
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 22nd, 2004, 04:45 PM
Authorized User
 
Join Date: Mar 2004
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default MEMO FIELD! With VB6

Okay, I've been out of the VB6 loop for a while and remembered having an issue with this a while back, in which I cant remember the solution.

I have a VB form that is connecting to the database and retrieves information (obviously ;p). The issue that I'm having is retrieving the information within a memo field from a MS Access database.

My connection and recordset code is correct and I have retrieved info just before the call, but when it comes to the memo field, I'm constantly getting "null" run-time errors.

MstrSQL = "select js_file_code from js_file where identifier='" & replace(cmbIdentifiers.text),"'","''") & "'"
MobjRS.open MstrSQL, MobjCN
   if isnull(MobjRS.fields("js_file_code")) then
     MstrFile = ""
   else
     MstrFile = MobjRS.fields("js_file_colde")
   end if
MobjRS.close
...

Funny issue here, is that on the line of "if isnull" it passes that error check which is true in the database... but when I try to assign the value to a variable, it gives me a null error...

This is frustrating me lol, so any help will do.

Thanks in advance!
Rolandatem
 
Old November 22nd, 2004, 04:48 PM
Authorized User
 
Join Date: Mar 2004
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

oh, I forgot to add, that if I tell the code to post the sql query to my screen. I can copy it and paste it as a query in ms access, and it works perfectly.

 
Old January 28th, 2005, 10:49 PM
Authorized User
 
Join Date: Jul 2004
Posts: 34
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via ICQ to chipset Send a message via MSN to chipset Send a message via Yahoo to chipset
Default

 
Quote:
quote:
Quote:
Code:
MstrSQL = "select js_file_code from js_file where identifier='" & replace(cmbIdentifiers.text),"'","''") & "'"
MobjRS.open MstrSQL, MobjCN
   if isnull(MobjRS.fields("js_file_code")) then
     MstrFile = ""
   else
     MstrFile = MobjRS.fields("js_file_colde")
   end if
MobjRS.close
well you say nothing is wrong with the code! why not check the property of the js_file_code field tell it to return a zero value if null.

Arowolo





Similar Threads
Thread Thread Starter Forum Replies Last Post
Memo Field Brendan Bartley Access 11 December 13th, 2007 04:28 PM
Memo field not displaying meichmann SQL Server ASP 3 August 31st, 2006 11:36 AM
Pagefault from memo field dave_pollak Access VBA 0 November 24th, 2004 10:25 AM
Adding a date to a memo field mikericc Access VBA 2 November 25th, 2003 10:35 PM
Field format from Text to Memo sassenach Classic ASP Databases 0 July 24th, 2003 06:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.