Building SQL

M

Mark

I want to build a class that builds SQL statements (given a recordset as an
argument). I thought it would build a string that would be sent back to the
user program which could then be resolved in the user program and executed
with each new record.

So if the string sent back to the user program looks like:
strSQL = " "Insert Into " & strTable & " Values (" &
Chr$(34) & rst!fields(0) & Chr$(34) & ", " &
Chr$(34) & rst!fields(1) & Chr$(34) & ", " &
Chr$(34) & rst!fields(2) & Chr$(34) & ")" "

Is there any way to resolve the references in the user program so it becomes
an executable SQL statement (given rst and strTable = "myTable")?

strSQLTwo = Insert Into myTable Values ("xyz", "1a2b3c", "123")

Thank you,

Mark
 
T

Tim Ferguson

I want to build a class that builds SQL statements (given a recordset
as an argument).

The first bit is easy, but I don't understand the second half of this
sentence.

How do you imagine using an object based on your class module? If you can
explain the interface, the code is usually pretty easy to write.

All the best


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top