473,890 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create DB2 Database When Application Runs First Time Development in Vb.net

9 New Member
Hi Everybady

I Want To Create New Database When My Application Starts First Time My Application Developed In Vb.net

I Get The Error When I Run Command which I Have Command Is Like.

Expand|Select|Wrap|Line Numbers
  1.  Dim file As FileInfo = New FileInfo(Path.GetFullPath("TextFile1.txt"))
  2. Dim backupScript As String = file.OpenText.ReadToEnd()
  3. Dim strCommand As String = backupScript
  4. 'Dim strConnection As String = "Driver={IBM DB2 ODBC DRIVER};Database=evaidya;Port=50000;Protocol=TCPIP ;Uid=db2Admin;Pwd=tatya;"
  5. Dim strConnection As String = "Provider=IBMDADB2;DSN=MyName;UID=MyID;PWD=MyPass; "
  8. Dim DBConnection As OleDbConnection = New OleDbConnection(strConnection)
  9. Dim cmdSoftware As New OleDbCommand(backupScript, DBConnection)
  10. DBConnection.Open()
The File TextFile1.txt contain the command For database creation.....
is :


The Error occurred is as :

[DB2/NT] SQL0104N An unexpected token "CREATE DATABASE temp AUTOMATIC STORAGE YES" was found following "BEGIN-OF-STATEMENT". Expected tokens may include: "<values>". SQLSTATE=42601

This Command Runs on DB2 command editor.....But without get connected to other database....if we first connect to any database and then run this command then it not run....it gives an error...
Apr 20 '10 #1
0 1633

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

Similar topics

by: noah | last post by:
Does PHP have a feature to associate Cookie sessions with a persistent database connection that will allow a single transaction across multiple HTTP requests? Here is how I imagine my process: I have an series of interactive HTML forms. The user begins a Cookie session. A database connection is opened and a transaction is begun. After the user goes through any number of pages where they update the database they finish on a page where...
by: omission9 | last post by:
Any advice on the following would be much appreciated. I have thrown everything I have at it and am completely stumped. I apologize for the length, I have tried to be as succint as possible. I have a pythoncard/wxPython application. The application works well except that users were reporting occasional crashes. The application would simply stop and just hang. I was able to reproduce the bug faithfully and ran the application in the...
by: Ted Miller | last post by:
Hi folks, I'm looking at moving a large base of C++ code to .Net under tight time constraints. The code runs in mission-critical environments, and I am extremely concerned about the loader lock problem and the potential for deadlocks. After pouring over the available information, and trying a few experiments, I am still left with a few questions and issues I hope someone out there can shed some light on.
by: Frank Wilson | last post by:
Tom, It sounds to me like ASP, not ASP.NET is handling the request for WebForm1.aspx. This is most likely an IIS config issue that may have been caused by order of installation or reinstallation, or possibly even something that happened in IIS before .NET was installed. Here is a way to prove or disprove my theory:
by: Steve Richter | last post by:
I am getting error in a vbscript: ActiveX component cant create object: Excel.Application. The vbscript code is: Dim objExcel Set objExcel = CreateObject("Excel.Application") I am pretty sure it is a permission issue because the script works when I point the browser directly at the .htm file on the c: drive: c:\inetpub\wwwroot\DemoSite\VbScriptTest.htm
by: shsandeep | last post by:
The ETL application loaded around 3000 rows in 14 seconds in a Development database while it took 2 hours to load in a UAT database. UAT db is partitioned. Dev db is not partitioned. the application looks for existing rows in the table...if they already exist then it updates otherwise inserts them. The table is pretty large, around 6.5 million rows.
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is this: can Access create the document and place it as an OLE object to the relevant table? Any help is greatly appreciated. Ricky
by: nihad.nasim | last post by:
Hi there, I have a database in Access that I need on the web. The web page should connect to the database and write records for certain tables and view records for others. I want to know a reliable way of connecting Access to a server. I am willing to switch to any version of Access which might solve the problem. Which server would you recommend and what are the advanatages and disadvantatges of the server you propose? Please also inlcude...
by: tc | last post by:
Hi. I have a customer who is running our .net application, multiple clients connecting to an Access database. This ONE customer reports a great speed degredation when more than one client is connected. First client logs on and the system runs correctly. Second client logs on, both connected clients now run very slowly when retrieving data. Third client logs on, the speed on all three clients is no degraded even more. Etc.
by: Mr. X. | last post by:
Hello. How can I create aspnetdb from scratch ? (I want a script that create all table, views, etc... on that database). Thanks :)
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.