?
Solved

Validate SQL statement in VB5

Posted on 1998-11-30
11
Medium Priority
?
304 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 400 total points
ID: 1497875
I think that in order to get your request is by trapping errors
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

801 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