How can i delete a record in a table of
Access97 through the condition of time?
I used the sentence like this :
delete statistics47 where begintime = '3-05-99 15:45:12',it can work for sybase,but it doesnot work in Access.
and the Access cues :22005
[Microsoft][ODBC Microsoft Access 97 Driver] Data type mismatch in criteria expression.i tried many times for every format of time ,but all failed.
How can i do?
Who can help me?
Thanks for your work!
Making the underlying ODBC classes work simply is not an easy task.. so I like your wrapper class. Keep
The only slight worry is that some of the code may not be v3.5 compliant - easily fixed.
My contribution: I needed to find the tables available in the database, here's an additional function to
bool CSQLDirect::GetTableNames(CStringList& slTabs)
// Gets the table names in the database. SQLTables is expensive
// so return all the results now in a list of strings
Great but...be careful for the GetParent() function, it MIGHT return NULL to indicate an error, and then
you will jump-out-of-the-NULL pointer, which ends up as an access violation and the application is DEAD... It
must be checked before use the pointer. Assertion is not enougth as well.
First i have to thank for this source code.
In my project i have to connect with UserID and Password, so i changed the function Connect(CString) a
bit. If anyone needs the sourcecode
contact me. Later i will give a sample.
I like this class - it has saved me from creating about a million CRecordSets so far. However, I now need to
insert non-pritable stuff (e.g. CR/LF) into my database; I've been using CSQLDirect's ExecuteSQL to execute
an SQL INSERT command and this works fine ... until I need to insert a control character or single quote.
I've looked all over the 'net for advice on this without much luck. I know that you can escape character
literals in PostgreSQL by using \xHH (HH is a hex code), but I don't think this is a standard. So, my
o Is there a standard means of escaping non-printable literals in SQL INSERT commands?
o Could support for this feature be added to CSQLDirect?
What I'd like to know is how to use your methods to bind specific
database columns from multiple tables in the same database to variables
used for display/editing on a form. For example, if I have two tables
with this layout:
MT_ID C(11) // my notation for an 11 character string
MT_DATE1 date // oracle date field
MT_CNT I(5) // my notation for an integer with a max of 5 digits
and want to use this SQL statement to retrieve data from them:
SELECT MT_ID, MT_TYPE, MT_DATE1, MT_DATE2, MT_CNT, ST_DATE, ST_SIGN, ST_CODE, ST_COMMENT
FROM Master_Table, Slave_Table
WHERE MT_ID = ST_ID
AND MT_TYPE != 'CLOSED'
AND MT_DATE2 <= sysdate
one record at a time (for the obvious use of making a form to edit
records and be able to scroll through them sequentially).
My current code uses
as a method for extracting data from the database into my local vars.
Unfortunately, there is no MFC (or other that I know of) way to do this.
And having to make a separate CRecordset for each table used on each
form is not a viable solution. (That's what I was told to do by the
nice people at MSN.COM.)
I have only been using VC++ 6.0 and MFC for about a month now, so please
be gentle in your replies.