Replacing NULL values when selecting from an excel spreadsheet
I have the following select statement:
Set rsGetInvoiceContact = Server.CreateObject("ADODB.Recordset")
rsGetInvoiceContact.ActiveConnection = MM_conn_to_EFACs_STRING_ap
rsGetInvoiceContact.Source = "SELECT * from "& ActinicPersons &" p WHERE p.[Contact ID] = " + Replace(rsGetInvoiceContact__vInvoiceID, "'", "''") + ""
rsGetInvoiceContact.CursorType = 0
rsGetInvoiceContact.CursorLocation = 2
rsGetInvoiceContact.LockType = 1
rsGetInvoiceContact_numRows = 0`
Later on in my script I plus address line 1 with address line 2. The problem occurs when address line 2 has a NULL value. How can I replace that from the select statement so that if only address line 1 has a value, it will still insert into the database rather than leave a blank cell.
well without code to see I would only venture a guess that the statement IsNull might help you here.
Post up if this doesn't help out, but this should point you in the right direction.
If Not IsNull(rs("address2")) then
theaddress = rs("address1") & vbcrlf & rs("address2")
theaddress = rs("address1")
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)