I am able to create the database and also the table however, I cannot get the needed column created in the table. Here is the code:
Code: Select all
Procedure addSubCategory()
Input$ = InputRequester("AddSub-Category", "Sub-Category :", "")
If Input$ <> ""
dbFile = LCase(catselection) + ".db"
dbTable = LCase(input$)
dbAlias = LCase(catselection)
If CreateFile(#dbHandle, dbFile)
CloseFile(#dbHandle)
result = DatabaseUpdate(#dbaseID2, "ATTACH DATABASE '" + dbFile + "' AS '" + dbAlias + "'")
result = DatabaseUpdate(#dbaseID2, "CREATE TABLE '" + dbTable + "' (type CHAR(30))")
query$ = "INSERT INTO '" + dbTable + "' (type) VALUES ('" + Input$ + "')"
result = DatabaseUpdate(#dbaseID2, query$)
If result > 0
MessageRequester("Add Category", "Category added.", #PB_MessageRequester_Ok)
Else
MessageRequester("Add Category", "ERROR: Failed to add Category", #PB_MessageRequester_Ok)
EndIf
EndIf
Thanks