Link to home
Start Free TrialLog in
Avatar of garciafran
garciafran

asked on

Validate SQL statement in VB5

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.
Avatar of kswinney
kswinney

The easiest way to validate a SQL statement is to execute it and trap for a error.

Avatar of garciafran

ASKER

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.

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.
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
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.
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.
What type of SQL would you like to validate: ACCESS, ORACLE, SQL SERVER? They all use a different syntax.
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.
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?
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.
ASKER CERTIFIED SOLUTION
Avatar of majed100598
majed100598

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial