Solved

SQL Code generators - addin?

Posted on 2002-04-30
9
214 Views
Last Modified: 2010-05-02
I'm tired of retyping my field names. What tools are available that will let me PICK instead of TYPE- and will construct my SQL statements?

Is there a VB add-in?

There has got to be a better way.

What are my options? Anything worthwhile for 100$ or so?

Where do I start looking?
0
Comment
Question by:michael_wiswell
  • 2
  • 2
  • 2
  • +3
9 Comments
 
LVL 22

Expert Comment

by:rspahitz
Comment Utility
Where are you typing them in?
Instead, maybe you can use a generic procedure in a module that handles much of this for you?  It could certainly assemble the SQL statement for you.  As for getting the fields, you could probably create a user-defined control to query the DB and offer them to you or drop them into the clipboard for pasting.
0
 
LVL 5

Expert Comment

by:rkot2000
Comment Utility
studio 7.0(For Strongly typed datasets) :)) but it cost ~$2000

or you can use dataEnvironment to create different commands and copy/paste sql statemens
Or
Add-ins -> Visual Data manager
or
project ->add form (and choose data form wizard.)

0
 
LVL 28

Expert Comment

by:vinnyd79
Comment Utility
0
 

Author Comment

by:michael_wiswell
Comment Utility
I type the field names & sql statements into VB. I use stored procedures as well.

I am used to a case tool on the AS400. I would just pick my table, and then pick columns from that table. To select- I would just note which fields needed to match & supply the values. The other fields would be returned. The only time I ever typed the field names was as I created the DB2 relational database.

I have written some code to assemble SQL statments, but it is a real "poor mans" substitution.

Creating default "templates" for creating select, insert, update, and delete SUBs should be a piece of cake.

Menu option &NewSqlSub. Select a FUNCTION (SELECT or INSERT or UPDATE or DELETE). Pick desired table from a list (from default database). Select input parms. Select columns you want returned. Set PROPERTIES to change the cursor location, recordset persistence, etc.

The resulting Module Name takes the FUNCTION, concats the TABLE, maybe tack on a number...

Keep it all in a SqlMyDB.BAS or whatever.

It would be nive if it would also let you generate a set of fields for local or module usage: m_intSeqNumber as integer. Maybe with a prefix to denote the tie to the database.

If I had time I'd write it myself... but someone else has to have done this already. Heck, it might be a standard add-in.
0
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

 

Author Comment

by:michael_wiswell
Comment Utility
rkot & vinny- I saw your comments after the first. The code from planet source code looks VERY promising- have you used it?
0
 
LVL 28

Expert Comment

by:vinnyd79
Comment Utility
I downloaded it this morning but have not tried it yet.I'm going to try it out tonight.The one person that commented on it said it was the best vb add in they have ever seen so I figured I would check it out.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
I use Microsoft's ADO Stored Procedure Add-In for Visual Basic, but this only helps with Stored Procedures.

Anthony
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
You can download it from here:
http://msdn.microsoft.com/code/default.asp?URL=/code/sample.asp?url=/MSDN-FILES/026/000/152/msdncompositedoc.xml

Here is the description:
<quote>

ADO Stored Procedure Add-in  
This add-in automates the task of mapping Microsoft® SQL Server® stored procedure parameters to ADO command object parameters. It will insert ADO code into your Microsoft Visual Basic® project based on user-selected code generation options.

</quote>
0
 
LVL 3

Accepted Solution

by:
n_narayanan earned 59 total points
Comment Utility
Here is the code for you,

http://www.freevbcode.com/ShowCode.Asp?ID=75

Narayanan
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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 …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

744 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

17 Experts available now in Live!

Get 1:1 Help Now