Bah.ODBC Questions

BlitzMax Modules Forums/Brucey's Modules/Bah.ODBC Questions

I use a base table type with an s_ColumnNames:String[] array that is used to create the table in the first place.

Less efficient, but I imagine you could do this also:
	Method ColumnName:String(_s_table:String, _column:Int)
	
		Local s_name:String 
		
		'	Grab a row from the table
		Local query:TDatabaseQuery = Query("SELECT * from " +_s_table +" LIMIT 1")

		'	If we found a row
		If query And query.nextRow()
		
			'	Grab the row record
			Local record:TQueryRecord = query.rowRecord()
				
			'	Grab the field (column) of this record
			Local query_field:TQueryField = record.getField(_column)
				
			'	Grab the name of this field
			If query_field Then s_name = query_field.name
				
		EndIf
				
		Return s_name
		
	End Method