Solved

Validate SQL statement in VB5

Posted on 1998-11-30
11
259 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
 

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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now