I am trying to insert a variable in a SQL string but am not having any success in finding the proper sytax. I am coding in C++. Listed below is code section I am trying to figure out. This code is part of an ADO routine that adds a field in an Access Database.
Unfortunately what gets added to the database as a field is @Value.
char Value;printf("Input A String");scanf("%s",Value);sSQLCommand = L"ALTER TABLE TableIn ADD @Value nvarchar(20)";com->CommandText = sSQLCommand;
After some corrections, the following is the corrected code that executes in sSQLCommand:
sprintf_s(sSQLCommand,"ALTER TABLE TableIn ADD %s nvarchar(20)",TempField);