|
1st Help is not very descriptive of your problem, as everyone posting here is in need of some help.
2nd VB6? Why? It's obsolete by at least 7 years.
3rd You perhaps should look at a system of registration for example, taking some data from the PC and generate an ID that can be used to generate an activation key.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
I am writing an application that integrates with an accounting package(running on SQL). I need to add more tables to the existing database that only my application will use. I've created code to add the tables and it works fine. My question is where do I place this code in my program.
I currently run it when the application starts - it tries to create the table, if it doesn't exist it will create it, if it does exist I get an error and the code just continues without creating the table.
The problem with this approach is that every time the application runs it tries to create the table which I think is unnecessary, because after the first time the table would already be there.
I now want to add the code to create the table at the point where I need to use the table, i.e. when I try to read from the table and it is not there, I get an error and only then will the table be created.
Is this the right approach? And if so, how do I distinguish between different errors (if the problem is with the connection I do not want to create a table, but maybe display a message or something).
I hope this makes sense to someone.
|
|
|
|
|
It seems like unecessary to create and delete those tables every time. Just create them and that's all. Tables names and field names are same at each time you run the program, aren't they?
If yes, why to delete them and recreate them at each time.
Explain the target of the program and database use, so we will answer you more precisely.
Shay Noy
|
|
|
|
|
I do not delete the tables every time. They only need to be created once.
The application is for salesreps and they would add additional information about their clients that the accounting package doesn't cater for. The reason why I want to add the table creation in the code is so that I do not have to create the tables manually each time the application is run at a different site.
Am I going at it the wrong way?
|
|
|
|
|
Understood. I think that it is a good approach. The creation should be when loading but you have to check if the tables do not already exists and if they already exists just skip the creation step.
You also can think on a way how to create the tables in a setup project and not inserting the creation into your project.
Anyway, also then you will have to check that the tables are not yet created to prevent from crashing program.
Shay Noy
|
|
|
|
|
Thanks for the response - I'll look into putting it in some sort of a setup process.
|
|
|
|
|
Hello Experts!!
My problem is- "select * from data" i want to show result of this query on to crystal report.......I am using msaccess for a database.
|
|
|
|
|
|
I used code from given link....but give error "view report is not member of frmOrder"
Dim Report As New frmorder
Dim TableName(0) As String
Dim QueryString(0) As String
TableName(0) = "TableName" 'Pass The Table That you used in the crystal Report
QueryString(0) = "SELECT * FROM TableName" ' Pass the Query
'ReportForm.MdiParent = MainForm 'Pass For Mdi True
Report.ViewReport("CrystalReport1.rpt", TableName, QueryString, )
|
|
|
|
|
Hi all,
I'm connecting to a SQL database and reading the recordset(Rs1) sequentially using method MoveNext. This is what the data looks like:
It starts reading the records fine, but crashes on 2 records which are close together in the table(input). I'm almost certan that the problem is not in my VB6 app, but something to do with the recordset, plus it doesnt seem to have anything to do with conversion.
Here is the whole error message:
Run-Time error '-2147467559(80004005)':
SQL0802 - Data conversion or data mapping error.
This happens in the line:
Rs1.Movenext
Please assist.
|
|
|
|
|
It will help us if you post the problematic snippet code and in addition give more info on the fields (of table in database) type where the code is crashing.
Shay Noy
|
|
|
|
|
Hi guys
im trying do an application wherein it watches other applications activities.
like for example my application will watch for any dialog box generated by the
application specified in the settings.
any idea on where should i start?
|
|
|
|
|
|
Your question is to vast. You should more specify what you need, because it is complicated to answer you for this kind of question.
Shay Noy
|
|
|
|
|
thanks for your reply
ok so let me make my question more specific.
the core of the program is to watch a specific application for message boxes, dialog boxes, or error message boxes.
then get the text from the message box then put it in a log file
then preferably simulate a click event on the OK button of that message box
lets say that an application generates that a message box saying that a file is missing
id like to get that message then save it into a log file.
hope this will explain clearly
|
|
|
|
|
|
nope the watcher will get the message in the message box then save it to a log file
thanks for the links, will check later
|
|
|
|
|
Is there a way that vb .net can help deploying a SQL database. I want a way I can create an install disc and have the user run the install disc and have the sql database with mdf files install.
Does anyone know a way to do this? I know I can run the sql database installer from the setup, but how do I get the mdf files to automatically attach and be usable?
I can't think of anything cool and nerdy to say.
|
|
|
|
|
You could write some TSQL to automate the creation of a database, logi, user, tables, views, indexes, etc, and have you clients execute the script.
Commands to research:
CREATE DATABASE 'MYNEWDATABASE'
CREATE LOGIN
CREATE USER
sp_addrolemember 'db_owner','MYNEWDATABASE'
|
|
|
|
|
I wanted to avoid scripts. Is there a way to attach a database using vb .net code?
I can't think of anything cool and nerdy to say.
|
|
|
|
|
Hmm, I must have misunderstood you. I thought you were looking for a solution to "deploy" a database. To me "deploying" a database at a client site means that they have a server waiting for you and a database needs to be created, schema created and populated, then your application can run.
If all you need to do is "attach", then why can't you just have your connection string stored in a configuration file and have it load at run time.
I must be missing something. "deploy" and "attach" have different meanings for us.
Maybe someone else can chime in a provide a soltion for you.
|
|
|
|
|
Can you help me with this? I can create database (mdf) now I need to attach it to the sql instance. How can I do that in vb .net?
I can't think of anything cool and nerdy to say.
|
|
|
|
|
Sorry, I've never worked with SQL Express, just SQL 2000, 2005 and Oracle.
|
|
|
|
|
SQL Express is SQL 2005 with some limitations on the number of connections
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
If you haven't already done so, download the SqlServer samples (theyr'e on CodePlex now not MS Download) here[^], select the *.zip file if you want to select where to put them, or the *.msi file if you want them installed to your SQLServer Directory.
There's a shedload of useful routines, mini applications and utilities in there.
The one you want isn't, from memory, but it is here on MSDN - Server.AttachDatabase Method[^]
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|