473,469 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DAtabase is not closing

3 New Member
My Database is not closing after creating filed. Please advise
Expand|Select|Wrap|Line Numbers
  1. Set mydb = DBEngine.Workspaces(0).OpenDatabase("\172.22.30.41\Training-Data\Training\Gaus\Vertical Updates\Database21.mdb") 
  2. tb = mydb.TableDefs("Sheet1") enter code hereSet fd = tb.CreateField(Me.Date1.Text, dbLongBinary, 1000) 
  3. tb.Fields.Append fd 
  4. mydb.Close 
  5. Set mydb = Nothing 
  6. MsgBox " Date Created" 
  7. Exit Sub
May 8 '15 #1
1 1235
Seth Schrock
2,965 Recognized Expert Specialist
This looks like Access VBA. Is it?

I have never seen a database get closed. According to the MSDN website, setting the variable to nothing is the equivalent to closing it.

Also, you may need to append the table with the changes to the database again.
Expand|Select|Wrap|Line Numbers
  1. mydb.TableDefs.Append td
May 8 '15 #2

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

Similar topics

4
by: dustin lee | last post by:
Over the years I've gotten out of the habit of explicitly closing file objects (whether for reading or writing) since the right thing always seems to happen auto-magically (e.g. files get written...
7
by: Medved | last post by:
Hi, We have not a smallest access database (30 tables, 160 queries,35 forms,40 reports,15 pages) with some links to other databases and some sql queries from other databases.The databse is not...
5
by: nick_faye | last post by:
Hi, I am still a newbie to VB and using MS Access 2000. I am currently trying to provide a preview of reports before printing them. My program is simple: AC.DoCmd.OpenReport "MyReport",...
22
by: alecjames1 | last post by:
I have a form which the user must complete before closing. I have disabled the window x button and use my own exit button. When selected it checks to see if the user has completed the entries...
1
by: Vegar Hansen | last post by:
Hello everone. Can somebody help me? When I run my code I can read, write to and delete from database, but when I have done one of these things and try to copy the databasefile from my folder...
3
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
7
by: Martien van Wanrooij | last post by:
I have been faced a couple of times with the situation that I wanted to write a script and was worried about a too frequent opening and closing mysql connections. To give some examples: 1)I...
6
by: John | last post by:
Hi I have a vb.net app that opens an access database runs several sql action queries on the tables and closes the db. This is done every few minutes. The problem is that sometimes I get an error...
4
by: fperri | last post by:
I have a form that the user selects filters on and then presses a button to generate a report. Not all the time, but sometimes when you press the generate report button the database closes. There is...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.