Solved

Validate SQL statement in VB5

Posted on 1998-11-30
11
300 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hide vba in gp 7 126
Excel VBA - Run Time error '1004' Application-defined or object-defined error 4 512
Sub or Function is not defined 6 59
Macro problems with Excel file 6 52
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 …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

732 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