Click here to Skip to main content
15,896,378 members
Home / Discussions / Database
   

Database

 
GeneralStatements with Predicates Pin
Melvin_MCW5-Mar-05 6:11
Melvin_MCW5-Mar-05 6:11 
GeneralRe: Statements with Predicates Pin
NassosReyzidis10-Mar-05 0:47
NassosReyzidis10-Mar-05 0:47 
GeneralDate Time shows different Pin
Tom Wright4-Mar-05 5:54
Tom Wright4-Mar-05 5:54 
GeneralRe: Date Time shows different Pin
numbrel5-Mar-05 3:45
numbrel5-Mar-05 3:45 
GeneralRe: Date Time shows different Pin
Rob Graham5-Mar-05 12:08
Rob Graham5-Mar-05 12:08 
GeneraloracleDataAdapter & Parameters Pin
Gerder3-Mar-05 0:56
Gerder3-Mar-05 0:56 
GeneralRe: oracleDataAdapter & Parameters Pin
numbrel7-Mar-05 10:38
numbrel7-Mar-05 10:38 
Generalinsert record into field names that contain brackets Pin
elephantstar2-Mar-05 8:08
elephantstar2-Mar-05 8:08 
Hi there,

I am having difficuly inserting a record into the database. I came to realize that it may be because of my column name that contains brackets. It inserts just fine with other fields that are the same data type but it stops at the bracketed field name. How can I get around this? I can change the column name to exclude any spaces because it's a pre-defined format. I tried bracketing the field name within my code so it's the same as in the design view but it still doesn't work. Can someone help me please. Here's my code below:
----------------------------------------------------------------------------------------------------

COleSafeArray vaFieldList;
vaFieldList.CreateOneDim(VT_VARIANT, 4);

COleSafeArray vaValueArray;
vaValueArray.CreateOneDim(VT_VARIANT, 4);

long lArrayIndex[1];
lArrayIndex[0] = 0;
vaFieldList.PutElement(lArrayIndex, &(_variant_t("NAME")));
lArrayIndex[0] = 1;
vaFieldList.PutElement(lArrayIndex, &(_variant_t("ADDRESS")));
lArrayIndex[0] = 2;
vaFieldList.PutElement(lArrayIndex, &(_variant_t("EMAIL")));
lArrayIndex[0] = 3;
vaFieldList.PutElement(lArrayIndex, &(_variant_t("[NUM CARS]"))); //will not insert this field

lArrayIndex[0] = 0;
vaValueArray.PutElement(lArrayIndex, &(_variant_t(m_name)));
lArrayIndex[0] = 1;
vaValueArray.PutElement(lArrayIndex, &(_variant_t(m_address)));
lArrayIndex[0] = 2;
vaValueArray.PutElement(lArrayIndex, &(_variant_t(m_email)));
lArrayIndex[0] = 3;
vaValueArray.PutElement(lArrayIndex, &(_variant_t(m_num_cars)));

pRecordset->AddNew(vaFieldList, vaValueArray);
pRecordset->Close();

Thanks!
GeneralRe: insert record into field names that contain brackets Pin
Michael Potter4-Mar-05 4:23
Michael Potter4-Mar-05 4:23 
GeneralSql Stored Procedure Pin
Mahesh16791-Mar-05 18:40
Mahesh16791-Mar-05 18:40 
GeneralRe: Sql Stored Procedure Pin
Anonymous1-Mar-05 19:00
Anonymous1-Mar-05 19:00 
GeneralRe: Sql Stored Procedure Pin
Mahesh16791-Mar-05 22:16
Mahesh16791-Mar-05 22:16 
GeneralRe: Sql Stored Procedure Pin
Tom Wright4-Mar-05 9:21
Tom Wright4-Mar-05 9:21 
GeneralOleDbDataAdapter.Update() should throw error but doesn't Pin
Florent Geffroy1-Mar-05 3:37
Florent Geffroy1-Mar-05 3:37 
GeneralRe: OleDbDataAdapter.Update() should throw error but doesn't Pin
Rob Graham5-Mar-05 12:20
Rob Graham5-Mar-05 12:20 
GeneralRe: OleDbDataAdapter.Update() should throw error but doesn't Pin
Florent Geffroy6-Mar-05 21:49
Florent Geffroy6-Mar-05 21:49 
Generalmultiple db systems in one app Pin
schilled1-Mar-05 2:45
schilled1-Mar-05 2:45 
GeneralRe: multiple db systems in one app Pin
-Dr_X-19-Mar-05 16:49
-Dr_X-19-Mar-05 16:49 
GeneralRe: multiple db systems in one app Pin
schilled20-Mar-05 22:22
schilled20-Mar-05 22:22 
GeneralSearching by degree of separation Pin
who2who228-Feb-05 23:19
who2who228-Feb-05 23:19 
GeneralRe: Searching by degree of separation Pin
Michael Potter2-Mar-05 4:03
Michael Potter2-Mar-05 4:03 
GeneralRe: Searching by degree of separation Pin
Colin Angus Mackay2-Mar-05 4:33
Colin Angus Mackay2-Mar-05 4:33 
GeneralExtended Stored Procedure from Trigger Pin
samvibes28-Feb-05 20:28
susssamvibes28-Feb-05 20:28 
GeneralRe: Extended Stored Procedure from Trigger Pin
Mike Dimmick28-Feb-05 22:57
Mike Dimmick28-Feb-05 22:57 
GeneralRe: Extended Stored Procedure from Trigger Pin
samvibes28-Feb-05 23:58
susssamvibes28-Feb-05 23:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.