Database Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesDatabase Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old August 12th, 2005, 06:27 AM
bwt1978 bwt1978 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 1 bwt1978 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 16 m 50 sec
Reputation Power: 0
Unhappy problem creating a new database from asp.net

Hey guys. Very new to all this. Trying to learn. My current project is to build a website that can be accessed by my friends. I have (briefly) designed a page or two to accept their details and passed this information to an aspx page. I am now trying to cause this page to create a new database, the aim being to store their information in this database. The problem I have is that when I try to use the code

Dim dbconn As OleDbConnection

Dim dbcomm As OleDbCommand

Dim sql As String

dbconn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & Server.MapPath("user_records.mdb"))

dbcomm = New OleDbCommand("CREATE DATABASE user_records.mdb")

dbcomm.ExecuteNonQuery()

I get the error:

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: ExecuteNonQuery: Connection property has not been initialized.

---------------------------------------------------

Obviously, when I reverse things to open a connection first I get told that the file I'm trying to connect to doesn't exist.

What am I missing? I'm sure it's something really simple, but the help files are appalling and everything is quite confusing when you're starting out... Does anyone remember programs that went like this (BASIC from the 1980s):
10 REM NEW PROGRAM:
20 INPUT "What is your name";a:

Actually, don't worry. I've found a copy of access and created a database there which is easily accessed by my meagre programming skills. Thanks anyhow.

Last edited by bwt1978 : August 13th, 2005 at 09:05 AM. Reason: fixed problem

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesDatabase Development > problem creating a new database from asp.net


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway