As I was reading John's question, Dave's answer magically appeared in the browser! It's a good answer, but we can go even further. The key, as Dave pointed out, is that the importtext statement uses a formula to access the data to import, so this text can come from anywhere.
Let's say you have a variable named fileData that contains tab separated data, and that the first line in this text contains the field names. This code will create a new database with this text and set up the field names.
fieldNames = firstline(fileData)
fileData = arrayrange(fileData,2,-1,cr())
This code was extracted from the newdatabasewithtextfieldnames statement. You can use Open View to look at the original code of this statement.