473,320 Members | 1,993 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Why this variable is becoming blank or null?

228 100+
I just finished building a functional database program and was about to submit it. The startup is sub_main() which connects to access database, as follows

Expand|Select|Wrap|Line Numbers
  1. 'public variable
  2. public db as new adodb.connection
  3.  
  4. sub main()
  5. 'create connection
  6.  
  7. end sub
  8.  
  9.  
The connection is created and works fine. At first my application was using MDI FORM based where everything was in the MDI Form thru buttons. But now, they wanted a "Switch Board Form" so sub_main() opens frmswitch which got 10 buttons for each form.

Now, the problem is when a button is clicked to open a form and that opened form have to get something from the database as it opens up [at form_load], like this:

Expand|Select|Wrap|Line Numbers
  1. dim rs1 as new adodb.recordset
  2. rs1.open sql,db,adopenkeyset,adlockoptimistic
  3.  
it generates error because connectionstring of db variable becomes null. I don't know when the error emerges because sometimes it works fine, sometimes it doesn't.

I never had the problem in the previous application, just when the whole Switch Board application request came in.

Why would db.connectionstring became null or blank?

[/code]
Jan 19 '11 #1
0 875

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Mark Davenport | last post by:
Hi, Here's my question: How do I pass a NULL value in a variable to a MySQL DB? Here's an overview of my problem: I have a PHP page that processes code, then inserts the code into a database....
1
by: Arthur | last post by:
I have a mix web site, ASP and ASPX files. I have assigned a value to Session("Date") and the href to an ASPX page. When I further href to another ASP Page. The content in Session("Date") becoming...
4
by: GazK | last post by:
I have a script which takes the results of a form and updates or creates a record in a db table. So far so dull. It works fine, except when I leave certain fields blank; these are entered in the...
42
by: =?Utf-8?B?UGxheWE=?= | last post by:
I have an if statement that isn't working correctly and I was wondering how I check for a blank string. My Code Example if me.fieldname(arrayIndex) = "" then ----- end if When I do this and...
3
ADezii
by: ADezii | last post by:
Null as it relates to database development is one of life's little mysteries and a topic of total confusion for novices who venture out into the database world. A Null Value is not zero (0), a zero...
3
by: tino101 | last post by:
I would like to stop this from being shown? <metadata name="REFERENCE_NUMBER" ordering="1"><xsl:value-of select="Reference"/></metadata> How do you stop it being outputted if it is blank? ...
0
by: Art Cummings | last post by:
Does anyone know how to initialize a char variable to blank or null? Thanks Art
1
by: Lumpy | last post by:
Hi All, Let me just start by saying that this isn't a big deal, I did find a way to get it working, but I was just wondering what the "correct" way of going about this is. I am using access...
6
by: ndeeley | last post by:
Hi, How do I insert a null or blank field into a database using coldfusion? I'm new to CF and its proviing a bit tricky! My database date field accepts null values (I think - theres no default...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.