Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 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 January 11th, 2006, 06:47 PM
Registered User
 
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to momoi
Default im new here and i need ur help....

im making a datareport in vb 6 and my database is mysql. my problem is that, in the data environment i added a command in the connection and this is my sql statement:

SELECT (tblmaster.emp_lname+', '+tblmaster.emp_fname+' '+tblmaster.emp_mi+'.') as Name, tblmaster.emp_slary, tblpos.*, tblaca.*, tblpera.*,(tblaca.aca_amount+tblpera.pe_amount) AS Total FROM tblmaster inner JOIN tblpos ON tblmaster.pos_name=tblpos.pos_no INNER JOIN tblaca ON tblmaster.emp_code=tblaca.aca_empcode INNER JOIN tblpera ON tblmaster.emp_code=tblpera.pe_empcode ORDER BY tblmaster.emp_lname ASC

when i try to view the datareport, the value returned or retrieved for Name(in bold text above) are 0's but the other fields are ok. whats wrong with the query? is that how it is done when concatinating fields in querying fields using mySQL database? but with my previous projects using access as database, there was nothing wrong. hope u could respond to this problem. i really need it.. thanks!!!! God Bless!!!

 
Old January 19th, 2006, 06:08 PM
Registered User
 
Join Date: Jan 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have found through SQL server that when trying to concatenate two fields, if one of them is Null the result is Null.

This may be the same type of issue you are running in to.

Look for a command such as NVL (Oracle) or IsNull (Sql Server) to set the Null field to a non Null value.

 
Old January 30th, 2006, 11:44 PM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nalla Send a message via Yahoo to nalla
Default


Hi,
When SET CONCAT_NULL_TIELDS_NULL is ON then, concatenating a NULL value with a string yields a NULL result.
Ex: -SELECT 'nalla' + NULL yields NULL.
When SET CONCAT_NULL_YIELDS_NULL is OFF then, concatenating a null value with a string yields the string itselt
Ex:- SELECT 'nalla' NULL yields nalla


nalaka hewage





Similar Threads
Thread Thread Starter Forum Replies Last Post
can anybody share ur knowledge wth ajax kunchala_rakesh Ajax 1 September 13th, 2007 10:10 PM
Need ur help anils Visual Basic 2005 Basics 0 May 27th, 2007 02:55 AM
Need ur help anils Visual Basic 2005 Basics 0 May 27th, 2007 02:53 AM
i want ur help! thanx! vincentaries C++ Programming 2 September 18th, 2006 03:04 PM





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