|
Your query didn't have any output fields.
Probably something wrong with the query.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Ok but same query i have check in mysql,then it's working fine.If you have any more query then plz give me.
|
|
|
|
|
See if this [^] helps.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi CPallini
Thanks for reply.may i know where is concept of my question in your post?Plz help me
|
|
|
|
|
It looks like you've to change the flag "Ignore # in table name" in your ODBC driver in order to make the statement 'SHOW DATABASES ' work.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
So i change
CString szSql = "SHOW DATABASES"; to this
szSql = "SHOW DATABASES from mysql",
or
rs.Open( CRecordset::forwardOnly, szSql); to this
rs.Open( _T("Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=;User=root; Password=root;Option=3;"),szSql,CRecordset::forwardOnly);
Both are givesame debug assertion.
Plz help me
|
|
|
|
|
Ummmmm - "SHOW DATABASES" isn't SQL? It IS a MySQL command - but that doesn't necessarily make it something you can execute using ODBC?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
yaa i know "SHOW DATABASE" is Mysql command and i am useing for MySql.Can you tell how and which command is execute for SHOW DATABASE useing ODBC?
Plz help me
|
|
|
|
|
You may try 'SHOW SCHEMA ', it looks like more 'SQL standard'.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Don't think you can use CRecordset - I don't think it lets you execute arbitrary commands.
You could use CDatabase::ExecuteSQL - but that doesn't return any results.
You can use ODBC to execute that command - here's how you'd do it in Python
import dbi
import odbc
conn = odbc.odbc("Driver={MySQL ODBC 5.1 Driver}; Server=localhost; Database=; User=root; Password=password; Option=3;")
curs = conn.cursor()
curs.execute("SHOW DATABASES")
curs.fetchall()
results in something like this
[('information_schema',), ('mysql',), ('test',)]
Here's how you could do it in C++ with ADO:
#import "libid:2A75196C-D9EB-4129-B803-931327F72D5C" rename("EOF", "adoEOF")
int main()
{
CoInitialize(0);
ADODB::_ConnectionPtr conn(__uuidof(ADODB::Connection));
conn->Open(_bstr_t("Driver={MySQL ODBC 5.1 Driver}; Server=localhost; Database=; User=root; Password=password; Option=3;"), "", "", 0);
ADODB::_RecordsetPtr rs = conn->Execute(_bstr_t("SHOW DATABASES"), 0, ADODB::adCmdText);
_variant_t databaseNames = rs->GetRows(ADODB::adGetRowsRest);
}
databaseNames is a SAFEARRAY containing BSTR elements, one for each database name.
Last modified: 3hrs 14mins after originally posted --
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
Hi Stuart Dootson
This things is working fine.But i need to use "Select * from Tablename".Show how can i get full information of table in
_variant_t.
Plz help me
|
|
|
|
|
It's not too difficult to find[^] appropriate examples[^] on t'Internet.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I am working on VC++ project where I am using VSFlexGrid.
I need to copy a string from any editor (e.g notepad, MS Word etc) and after validating for certain
conditions, paste the string in FlexGrid cell, if validations conditions are true.
I have tried using KeyPessEdit event for ctrl+v (ASCII == 22)
I tried something like this :
if(*KeyAscii == 22)
{
// Paste the string in FlexGrid cell
char* tempString= NULL ;
string buffer = NULL ;
bool bIsValidChar = true;
tempString = (char*)GetClipboardData(CF_TEXT);
for(int i = 0; '\0' != tempString[i]; i++ )
{
if( (tempString[i] >= 65 && tempString[i] <= 70 ) || tempString[i] >= 48 && tempString[i] <= 57))
{
continue;
}
else
{ bIsValidChar = false;
break;
}
}
But in this case before control reaches to 'bool bIsValidChar = true;' string copied from elsewhere gets pasted in FlexGrid cell. That means by default implementation of Paste method of FlexGrid is getting called.
So how can I do my validations and then allow or disallow the pasting of string in a cell.
How can I handle FlexGrid's OnPaste event ?
|
|
|
|
|
Hope you may find the answer from this forum[^].
|
|
|
|
|
check events provided by flexgrid control!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I have names of certain students and their ages stored in a text file
'records.txt'.
LIKE:
John 22
Paul 21
Sam 24
Harry 23
Now i want to store these ages and names in a structure 'records(r)' directly from the file. (Here i am not taking any input from the user)
as r.name & r.age.
Any clue to the solution???
|
|
|
|
|
I believe this query was answered
|
|
|
|
|
I couldn't get that. Plesae elaborate the clue so that i can learn a bit more.
I am trying to use the "isdigit" command for this purpose. Would that be suitable?
|
|
|
|
|
Dear Razanust,
I'll first suggess you not to create a new thread if you aren't satisfied with the answer.
Razanust wrote: couldn't get that. Plesae elaborate the clue so that i can learn a bit more.
I am trying to use the "isdigit" command for this purpose. Would that be suitable?
Now, as your file is a text file, First Clear whether you have stored it by formating by sprintf and then WriteFile etc or Writing the structure directly?
HARSH
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.
modified on Tuesday, June 30, 2009 3:59 AM
|
|
|
|
|
Razanust wrote: Any clue to the solution???
1. Read the file line by line
2. use something like strtok to tokenize each line
3. fill the structure
|
|
|
|
|
I Don't know why u are trying there tipical methods.
Just Try the "C" way: -
struct MyStruct
{
char Name[20];
int age;
}
MyStruct myStruct;
FILE *pFile = fopen("Record.txt", "Wb+");
fwrite((char*)&myStruct, sizeof(MyStruct), 1, pFile);
and to reead :-
fread((char*)&myStruct, sizeof(MyStruct), 1, pFile);
HARSH
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.
|
|
|
|
|
Harsh Shankar wrote: I Don't know why u are trying there tipical methods.
What?
|
|
|
|
|
Wouldn't it be easier to read and write the data in the file by my given way??
HARSH
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.
modified on Tuesday, June 30, 2009 5:25 AM
|
|
|
|
|
I don't see anything in his post about writing the data back to a file. He only wants to read the file and store the tokens in a structure (or presumably an array of structures).
|
|
|
|