473,395 Members | 1,975 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,395 software developers and data experts.

Creating a database at run time

vdraceil
236 100+
How do i create a database(.mdb) file at run time with a password?Any one please give me the code.Also,how am i supposed to access that file?-i know to open a .mdb file without a password.
Dec 9 '07 #1
7 2971
9815402440
180 100+
hi

simple way is to keep blank database for the purpose. when you need new database then copy it to the location where you want it. i dont know whether database can be cereated at runtime but tables can be created in an existing database. i can submit the code to create tables two or three days after today.

regards
manpreet singh dhillon hoshiarpur
Dec 9 '07 #2
vdraceil
236 100+
thanks for your reply..it'll be better if i have a code for it
Dec 11 '07 #3
QVeen72
1,445 Expert 1GB
Hi,

Use DAO's to Create Database:

Dim DB as Database
Set DB = DBEngine.CreateDatabase("C:\NewDb.mdb", dbLangGeneral)
DB.NewPassword "", "MyPassword"


Regards
Veena
Dec 11 '07 #4
vdraceil
236 100+
Hi,

Use DAO's to Create Database:

Dim DB as Database
Set DB = DBEngine.CreateDatabase("C:\NewDb.mdb", dbLangGeneral)
DB.NewPassword "", "MyPassword"


Regards
Veena
How to open that password protected database by code?
Dec 11 '07 #5
debasisdas
8,127 Expert 4TB
How to open that password protected database by code?
pleae try this sample
Expand|Select|Wrap|Line Numbers
  1. oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
  2.            "Data Source=c:\somepath\mydb.mdb;" & _ 
  3.            "Jet OLEDB:Database Password=MyDbPassword", _
  4.            "myUsername", "myPassword"
  5.  
Dec 11 '07 #6
vdraceil
236 100+
how do u create tables and fields by code??
Dec 16 '07 #7
Place a button on a form called "Command1"


Dim DB As Database

Private Sub Command1_Click()

'1) Create DataBase name "Names" using DAO
Set DB = CreateDatabase(App.Path & "\Names", dbLangGeneral, dbEncrypt)

'2) Create Tables and Fields (rename Table and fields as needed) using DAO
' and the Microsoft Jet SQL
DB.Execute "CREATE TABLE Table1 " & "(First CHAR (50), Last CHAR (50), Age INT, Other Info NOTE);"

'3) Create Password
DB.NewPassword "", "MyPassword"


DB.Close 'This Line is Optional
MsgBox "DataBase Created."
End
End Sub
Jan 30 '08 #8

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

Similar topics

6
by: Dim St Thomas | last post by:
I am a developer working on a database client program. I am testing this program on a Windows XP machine (1.5 GHz AMD chip, 480 Mb RAM, 60 Gb disk) This machine has Oracle 9.2.0.1.0 and RedBrick...
3
by: Bruno Luis | last post by:
Hello I'm using A97 and i'm having some trouble with creating a recordset with data from two different databases. I connect to a remote database and make this data the default source for my...
4
by: Tony | last post by:
G'day My attempt to create an MDE file was unsuccessful. The attempt produced an error that effectively said the (MDB) file was to big. The MDB consists of about 30 tables, 50 forms and 3...
7
by: John Baker | last post by:
Hi: I would like to know how to create a temp DB to store the data in a table while I do something else with the table. Specifically, how do I create the temp remove the temp I want to be...
2
by: Anand Sagar | last post by:
I have a Panel1 and button1 on my webform. At runtime, I create 2 textboxes. I do it at the Page_Load event. I put the code within the " If Not isPostBack" For the button click event, I will do...
6
by: Jerry Spence1 | last post by:
Why doesn't the following work in my ASP program? I have imported ADOX I am trying to create a temporary database on the user's PC. The example is taken from Microsoft. Dim cat As Catalog =...
4
by: Coleen | last post by:
Hi All :-) Can anyone give me a URL where I can find a good example of code on how to create a temporary SQL table using VB.net? I've checked the Microsoft site at: ...
11
by: JohnJSal | last post by:
It seems like what I want to do is something that programmers deal with everyday, but I just can't think of a way to do it. Basically, I am writing a DB front-end and I want a new "Researcher"...
26
by: nyathancha | last post by:
Hi, How Do I create an instance of a derived class from an instance of a base class, essentially wrapping up an existing base class with some additional functionality. The reason I need this is...
3
by: Sean C. | last post by:
Hey All, I'm having a little problem here. I have a project that I'm working on that involves a MySQL server database backend. I'm having no problem creating the database on the fly if it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.