Solved

Validate SQL statement in VB5

Posted on 1998-11-30
11
281 Views
Last Modified: 2013-12-25
I have a word editor made in Visual Basic 5.0 and I want to add a function that allows validation SQL statements. I would be glad if you could send me the code of a function or program that makes something like this.
0
Comment
Question by:garciafran
11 Comments
 
LVL 2

Expert Comment

by:kswinney
ID: 1497865
The easiest way to validate a SQL statement is to execute it and trap for a error.

0
 

Author Comment

by:garciafran
ID: 1497866
The idea is to have a compilator in the word editor, a basic one, that can validate a SQL statement, as CREATE TABLE, WHERE, SELECT * FROM PEDIDOS WHERE FECHA PEDIDOS , so it tells that the statement is correctly given to the program.

0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1497867
In your vb there is a vizdata project that comes with a source code.
You can make a copy of this code and parse the component that are needed into your code.

The vizdata have all the comments that you need.

Try it.

View the vizdata source code and see if it answer your question.
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:garciafran
ID: 1497868
The idea is to have a compilator in the word editor made y VB 5.0, a basic one, and I want to add a function that allows validation SQL statements. I would be glad if you could send me the code of a function or program that makes something like this. that can validate a SQL statement
0
 

Author Comment

by:garciafran
ID: 1497869
I have a word editor (compilator) made in Visual Basic 5.0 and I want to add a function that allows validation SQL statements. I would be glad if you could send me the code of a function or program that makes something like this.
0
 

Author Comment

by:garciafran
ID: 1497870
I have a word editor made in Visual Basic 5.0 and I want to add a function that allows validation SQL statements. This funcion must make the analisys sintax of the statements SQL. I would be glad if you could send me the code of a function or program that makes something like this.
0
 

Expert Comment

by:chiche
ID: 1497871
What type of SQL would you like to validate: ACCESS, ORACLE, SQL SERVER? They all use a different syntax.
0
 

Author Comment

by:garciafran
ID: 1497872
I want to validate a SQL statement from SQL SERVER. The idea is that the word editor compilates the SQL statement like a normal compilator does, if you could tell me what is an easy way to do this it would be just fine.
0
 

Expert Comment

by:chiche
ID: 1497873
Well, your are not going to "compile" the SQL statement, just check the syntax, right? Is it in the context of a real database? for exemple: should "SELECT * FROM table1" return an error because "table1" doesn't exist?
0
 

Expert Comment

by:grewa
ID: 1497874
You could create a program that would search the code of the SQL related program for SQL related statements and then refer back to a txt file that has a list of SQL statements you comenly use.

I will put source code up for you when I get a chance.
0
 
LVL 2

Accepted Solution

by:
majed100598 earned 200 total points
ID: 1497875
I think that in order to get your request is by trapping errors
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question