[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

SQL queries


This is what I am doing currently ;
Pulling in a CSV file into memory with 'many'(1000+) records - stripping out one colum. I have a text box to type in the first part of the SQL query and a text box to type any other part of the SQL query that comes after the data to be processed.
THis is output to a file, which I then cut and paste into MSSQL Manager and run. Obviously all I want to do is to remove the cut and paste and save to file part of the operation and output to a file (which I eventualy want to e-mail to someone).
Thanks in advance

Best Regards
0
ewocks
Asked:
ewocks
  • 3
  • 3
1 Solution
 
mayhewCommented:
So you're already generating the query.

All you want to do is make the connection to your database directly instead of pasting the query into ISQL and then have the results go into a text file?

If you like, I can send you an example of connecting to a database, getting a resultset, and putting the resultset into a text file.

Do you have an ODBC DSN to connect to your database?
0
 
ewocksAuthor Commented:
Yes please and Yes
0
 
mayhewCommented:
Post your e-mail address and I'll send you a zipped project.

Since you're using ODBC and SQL Server, I chose RDO as the data access method.

I assumed this was a learning exercise for you so I did everything pretty  deliberately.

Please keep in mind that my code is not the only way to do this.  For example, I defined variables for each field in the table.  This isn't necessary, I just felt that it improved readability.

Also, be sure that your project references the Microsoft Remote Data Object.

You'll need to replace a couple of things in the code with your info, for example, your db uid/password and your DSN.  I marked those parts with comments.

I'll send it as soon as I get your e-mail.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
ewocksAuthor Commented:
Thanks very much

paul.cowie@dataflex.co.uk
0
 
ewocksAuthor Commented:
Thanks for all your help
0
 
mayhewCommented:
I'm glad I was able to help.

Thanks for the increase!  :)

Let me know if you have any other questions.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now