|
I need to get schema info (viz: primary/foreign keys, indexes) for a table in access.
Am I able to use ADO.NET or do I still have to use ADOX?
Any code samples?
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
If Access is now running off MSDE, why am I not able to select from the system tables as in SQL personal edition?
Any ideas?
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
Say I have two queries that are of a similar structure, and take parameters for a client ID e.g. from ADO I would call them like..
First Query
{CALL qData1 ('Mr Bob') }
and the Second Query
{CALL qData2 ('Mr Dave') }
If I wanted to use these in a Union how would I build it, as I cannot seem to figure out how to use Queries/Stored procedures with parameters in a Union.
Any ideas?
|
|
|
|
|
I have a datagrid which I use to update a table but I have a little paging problem
when I add a new entry I would like to page to the last page but I do not know which is the last page as it could have incremented by the addition of the new record.
is there a way of seeing from the datagrid or dataset just how many records there are (or were) or should I just do another query on the database to get a recordcount. Its probably in there but I just can't see the wood for the trees.
Thanks again
Shaun
|
|
|
|
|
ShaunW wrote:
I do not know which is the last page
Maybe pagecount property is what you want.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
I have an access database mounted via an ODBC datasource
I can view it in the solution explorer but when I try to access it I get the following message 'You cannot use an OLE DB provider for ODBC drivers'. What does that mean? How do I access the database via this route.
I can view the same database if I use the jet drivers however the jet drivers treat my date/time fields as pure date fields and so I lose all time (hours,mins,secs) information.
Please help
Shaun
|
|
|
|
|
okay I've switched my database to SQL 2000 and that version of datetime works fine - but if anyone can help with the above it would be appreciated.
Shaun
|
|
|
|
|
The error message means that you cannot use the OLEDB Provider for ODBC to access an ODBC datasource through the System.Data.OleDb objects. You need to download the ODBC.Net provider from Microsoft and use that instead.
|
|
|
|
|
Help please - I have an INSERT query of the form:
INSERT INTO MyTable (Field1, Field2...) VALUES (Value1, Value2...)
into a SQL Server Database. It is failing due to invalid text in one of the Parameters.
Now, I want to report the SQL query and Parameter Values when the failure is detected to aid debugging any future issues.
But GetSQL() only returns the SELECT query - the m_strUpdateSQL contains the "INSERT ... VALUES (?, ?...)" but there is no access Function!
Also if I try to use GetFieldValue() (to try to report the parameter values) my application just dies with an exception - presumably because they are only valid for a SELECT?
Is there any way to get at the Parameter Values?
Any help from someone out there who is familiar with CRecordsets, etc. would be gratefully received.
|
|
|
|
|
Hi..
I use ADO to store Images in a SQL Server 2000 Database
I want to know how to get the size of th stored image..
second: The log file Gets full quickly as I save large data .. Is there a way to truncate it after completing the Image saving Operation ?
|
|
|
|
|
1) select DataLength(imagefieldname) from TableName
2) use the WriteText/ReadText stuff which is not looged.
|
|
|
|
|
I have created a ATL/COM project in VC6 that will run as a service. Then I added a OLE DB Provider and modified it to just return 2 rows of a very simple record layout.
It compiles with no errors or warnings!
Then I launch Visual Basic and create a standard exe projekt, the first thing I do is to add a DataEnvironment Designer. When I open the property dialog on "DataEnvironment1" I get a list of providers to choose from, and my provider is also listed there.
When I select the provider I have created and presses next button, I get an error message saying something like this: "The provider is not available, check that you have installed it correctly" !!!!!!
What have I missed? How do I install/register my provider?
I have ofcourse started the service!
Don't give me a RTFM, cause I have!
Confused
|
|
|
|
|
Is there any way to create a Jet database using ADO? I was using
CreateDatabase() with DAO, but now my employer wants ADO code ( yes, i´m always way behind the technology curve ) ). I found the
dao to ado migration guide on msdn but it uses ADOX. Any Idea???
Thanks
Gabriel
Old C programmers never die. They just cast into void
|
|
|
|
|
As far as I know ADO does not have db creation functionality.
database creating and structural management should be done via ADOX (which is very easy to implement!)
-chin-
|
|
|
|
|
I need to hook Visual C++ to a Visual Foxpro database. There is a mention of an OLE Provider (vfpoledb on the Micrsoft site) and there is even an example of this on Codepage. But where can I get it?
I have now installed Fox Pro itself but no joy, my machine is XP is that makes any difference.
Can someone please point out the obvious to me?
|
|
|
|
|
Found it! - Its supplied with Foxpro 7
|
|
|
|
|
Hello,
I'm working on an application where the user needs to be able to select an external database to use within the application. I can handle mdb, db files, etc. But I'm not really sure how to handle allowing the user the ability to select and ODBC data source for example. Does ADO have some functionality that would allow me, the developer, to surface a standard dialog that the user could either select an ODBC data source and/or create and OLE DB source to access the data?
I guess I'm looking for something similiar to ODBC's SQLConfigDataSource functionality. Perhaps this is my answer???
Thanks,
Rob
|
|
|
|
|
I'm not sure now but I remember in Open() function of your database there is a flag that specify if there is no ODBC database,open a dialog and user can choose database.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Found what I was looking for in the Interactive SQL tool example http://www.codeproject.com/database/isqlado.asp
It has some code showing the use of PromptNew. It was exactally what I needed for this project.
Rob
|
|
|
|
|
I am currently working on a system that uses an Access database to store a list of url's waiting to be processed. I need to be able to add to, and amend the database, and so, I have derived a class from the CRecordset class called CURLRecordset using the classwizard.
In my application, I can succesfully open a CDatabase object in order to connect to the database, but when it comes to opening the actual recordsets associated with it:
/*
CURLRecordset* unparsed_urls;
CDatabase* db;
CString sql;
*/
unparsed_urls = new ( CUnparsed ) ( db );
sql.Format ( "SELECT * FROM urls WHERE status = %d;", STATUS_NOT_CRAWLED );
unparsed_urls->Open ( CRecordset::snapshot, (LPCTSTR)sql );
I get the following exception:
"Invalid character value for cast specification on column number 2 (urladdress)"
I have traced the source of the exception to the final move() function call in the CRecordset class, but I have no idea how to deal with it. My database schema is as follows:
TABLE urls =
(
long urlid (PRIMARY KEY)
VARCHAR(256) urladdress
long status
long level
long keywordid
long sourceid
)
The header file for the CURLRecordset class is as follows:
class CURLRecordset : public CRecordset
{
public:
CURLRecordset(CDatabase* pDatabase = NULL);
DECLARE_DYNAMIC(CURLRecordset)
// Field/Param Data
//{{AFX_FIELD(CURLRecordset, CRecordset)
long m_keywordid;
long m_level;
long m_sourceid;
long m_status;
CString m_urladdress;
long m_urlid;
//}}AFX_FIELD
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CURLRecordset)
public:
virtual CString GetDefaultConnect(); // Default connection string
virtual CString GetDefaultSQL(); // Default SQL for Recordset
virtual void DoFieldExchange(CFieldExchange* pFX); // RFX support
//}}AFX_VIRTUAL
// Implementation
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
};
Any help will be greatly appreciated!
|
|
|
|
|
I made a Visual C++ application that uses ADO to query a database, and to update the changes.
I send some simple SQL statement to the database (an Access DB until now), like SELECT, UPDATE, etc.
Now I would like to make this through the internet.
I mean I run my program on my computer and it query the database that instead is on another computer, and it connects to it via tha Internet.
Where I can find a guide on how to do it?
Thankyou.
P.S.
I also think that I will need to use SQL Server or Oracle to store my database remotely, ad than use this server. Are there any service that offers this kind of hosting for free, so that I can start experimenting, without the hassle of installing my own SQL Server or ORACLE ?
Thank you very much.
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
First, yes you can query a database on another server across the wild web. This is done quite simply actually here is a DNSless connection string to a SQL Server
"Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;password=sa;Initial Catalog=pubs;Data Source=127.0.0.1;Use Procedure for Prepare=0"
You then change the IP addy in the Data Source attribute to point to the intended server. I've left a lot of details out here as to how it works etc. I recommend you do some studing in that area, but this should get you rolling .
Good Luck
|
|
|
|
|
Hi.
After added a record into a Recordset(offline),how to access the new added record?
Scratch
|
|
|
|
|
If you move your cursor from added record(i.e MoveNext() ),then it will be available and you have access to it.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
When use VB your advice is work very well,while using VC++ this seem does not work.
Scratch
|
|
|
|