|
THANKS NICK!!!!!
IS NULL works perfectly!
Ed
|
|
|
|
|
Howdy, does anybody know how to connect to an MSAccess database directly (using the file not a DSN) with VC without using MFC?
This database is also encrypted so it has a cmb & wgf as opposed to an mdb.
Some source or examples would be a life saver
I'll be eternally endebted to anybody who can help
Thanks
Desperate Damian
|
|
|
|
|
There are lot of articles in CP like this one:
http://codeproject.com/database/caaadoclass1.asp
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
There are many ways to do this:
* ODBC SDK
* DAO SDK
* DAO Automation interface
* ADO Automation interface
Since I cover each of these in my Visual C++ .NET bible, let me know which one you're interested in and I'll send you a simple maintanence-like application for that data access technology.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
Thanks, however my spec just changed again and the client want me to use SQL which isn't a problem. However they want me to access it using OLE which is a problem for me (I don't have a problem using ADO and ODBC but OLE looks ghastly to me). You can't help here can you ?????
Thanks
Damian Del Campo
|
|
|
|
|
Sorry mate. I have little to no OLEDB experience. It just never made sense as ADO is so much easier to use.
Cheers,
Tom Archer
Author - Inside C#, Visual C++.NET Bible
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the af
|
|
|
|
|
Yes you can use DAO sdk (you can find this in the last cd of VS 6.0)
Or you can use ADO...
In my Classes I use MFC, but here you can see any samples without MFC....
Best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
The MS DataGrid is used in my program,but it doesn't worked on the machine whithout VC++ installed. I have registered the msdatgrd.ocx and have installed the MDAC2.7. The Error messages is : " Can't initialize data bindings" ,
m_myDataGrid.SetRefDataSource( (LPUNKNOWN)rs ); //Error Message Ocurrors
VCBeginer
|
|
|
|
|
Just a guess:
Register msadodc.ocx too.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
I have the same problem with "Windows 7 RC", with XP and older no problem, I have registred
regsvr32 "Msadodc.ocx" regsvr32 "Msdatgrd.ocx" regsvr32 "Msdatlst.ocx"
Msadodc loaded data normally but Msdatgrd SetRefDataSource rise error "Can't initialize data bindings"
|
|
|
|
|
Hi,
What means this :
Optional feature not implemented
State:S1C00,Native ,Origin:[Microsoft][ODBC SQL Server Driver]
???? Is this any error ??
....
m_rec->Open(AFX_DB_USE_DEFAULT_TYPE,Sql.GetBuffer(0));
....
For connection to SQL server Iam using CDatabase+CRecordset
Thanks.
Wiizi
|
|
|
|
|
I don't know what is your specific problem, but ODBC Drivers developers doesn't necessarily implement every feature, there are optional features wich may or may not be present, that depends on the driver implementor.
Hope this helps.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
I'm using Microsoft Access to migrate some data from one database to another. It's a great tool, by the way, especially since you create link to the tables and then do queries that join them as if they were all from one database.
So what's my problem?
I need to do some manipulation of the data before I can migrate it. So I basically need to write either some "Macros" or "Modules" to do it (don't know which). I need some guidance as to how do this. For example, what objects should I use to perform queries and loop through the records, etc.? I don't know anything about Access's object model.
Can anyone point me to some online help or tutorials that can get me started?
Thanks in advance,
Alvaro
Kinda hard to sign my name without anything to write with. Anyone got a pen?
|
|
|
|
|
If you go into create a new module you can start by writing some function, this should get you started:
Function ModifyValues()
Dim sql as String
Dim conn as New ADODB.Connection
Dim adors as New ADODB.Recordset<p><pre>
conn.ConnectionString = [YourConnectionStringGoesHere]
conn.Open
adors.ActiveConnection = conn
sql = "Select * from [YourTableHere] "
adors.Open(sql)
do until adors.EOF
Make your changes here
loop
adors.Close
conn.Close
set adors = nothing
set conn = nothing
End Function
Nick Parker
J
This is a non-Calculus course as long as you know things like line integrals and surface integrals...
|
|
|
|
|
Thanks for your response Nick.
So you're telling me to use ADO. Hmmm, I was hoping to go closer to the metal, by using the Access engine and object model -- more like a DAO tutorial, I guess.
Regards,
Alvaro
Kinda hard to sign my name without anything to write with. Anyone got a pen?
|
|
|
|
|
ADO, yes. Is there a reason that you are wanting DAO? I'm not that familiar with those methods (DAO) to access data. I would have to assume that there is some partiular reason as to why you would want to use DAO because Microsoft recommends ADO (probably ADO.NET now) as the currently best method for database access.
Nick Parker
|
|
|
|
|
How i can return Recorset* variable, from COM+ object, written on VC.NET. Record to idl file not helps me.
|
|
|
|
|
Cannot help you with .NET, but I know how to do it in VS6 Maybe it can help you.
Actually you need to return a VARIANT , so other languages, like VB or VBScript can use it also. The code will look like this:
HRESULT GetRecordest(VARIANT * pResult){
....
<font color=green>
...
pResult->vt = VT_DISPATCH;
pResult->pdispVal = (IDispatch*)piRecordset;
return S_OK;
}
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
(To start, I am a C++ expert but database novice.)
There is a table in one of our databases that really bugs me.
Table A has a column containing an ID. Several rows can use that ID.
Table B also has an ID column with several rows using the same ID.
Table C was created with nothing but a column of ID so both A and B have a one to many relationship with it.
It is table C that bugs me. It's not just unaesthetic, it has a problem: if ALL the rows in Table A are deleted that reference a specific ID, all the rows in Table B need to be deleted as well.
More importantly, all the rows in table B that use a specific ID CANNOT be deleted if there is a single row in in Table A that references that ID (there MUST be at least one row in Table B containing that ID.)
Is there a way to create a constraint so table C can be eliminated?
Right now the table is in Oracle 7&8, though it's going to be in something, anything, else inside two months (Oracle licensing is killing us and Oracle has a very serious bug with connections that keeps biting us), probably SQL Server.
|
|
|
|
|
I'm a total newbie w/ SQL so i'm hoping I explain myself properly.
I have a table called 'addresses' which looks like this:
-----------------------------------------------------
ID Categorey Name Address
-----------------------------------------------------
categorey field can be one of the following:
1) Friend
2) Employee
3) Family
4) Other
If I wanted to query a database returning only those records with 'friend' and 'family' under categorey and the name I was searching for was
Ed but the query should return all likely matches if nothing was exact...?
So if Ed wasn't found...
Eddie
Eddy
Edward
etc...would be returned...
Can this be acocmplished in SQL or would I have to query the entire DB and sort though the recordsets manually...?
Thanx in advance.
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey wrote:
Ed but the query should return all likely matches if nothing was exact...?
"SELECT friend,family FROM addresses WHERE friends LIKE 'Ed%'"
This would return Ed and Eddie,Eddy,Edward.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Coolness
Thanx a lot!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Only one question
Why is friend plural after WHERE clause...?
Is thisa typo or a MUST...?
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey wrote:
Why is friend plural after WHERE clause...?
Is thisa typo or a MUST...?
Thats my mistake in typing,it should be exactly the same as your column name.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Mazdak is correct in that if you simply want to search for all entries where wildcards can be used as substitutes for characters, then you can use the LIKE predicate. However, if your needs are a bit more complex where you need to find sematically similar names like Richard=Dick or Tom=Thomas then you'll need to use SQL Server Full Text Indexing. If that's the case, let me know as I wrote an article for another site a couple of years ago. If you need it, I'll find it and send it to you.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|