|
what does versioning have to do with simply getting the next row of a dataset object? its in memory, not cursored to the actual database and very much unbound. for all you care, i could be creating the dataset in memory from no db at all.
the question is, and remains, how do i get the index of a row in a dataset given a DataRow object, and a DataSet object, and NOT the index of the current RowData object.
if i can say dataset.Table().rows[20] and get a DataRow object, shouldnt i be able to easily code dataset.Table().rows[_row.Index + 1] ?
|
|
|
|
|
How can I get the following SQL statement to take a string value after FROM.
SqlString = "SELECT * "
"FROM ?????";
The string name is strFolderOpen and this will hold the name of the Access database to open.
Thanks, Aoife
|
|
|
|
|
What language are you doing this in, VB, Javascript, C++
This should do it in VB:
<code>
SqlString = "Select * From '" & strFolderOpen & "'"
</code>
Let me know...
HTH
Nick Parker
|
|
|
|
|
What design would be more efficient...?
I have 6 tables:
1) Hardware
2) Software
3) Programming
4) Networking
5) Database
6) Technologies
Each table has Word, Description field(s). Is this a normalized DB or would it be better to....
New Table:
===============================================
PrimaryKeyID | Categorey | Word | Description |
===============================================
This way they are all stored inside the same table and instead of searching seperate tables for the word, I search only based on Categorey...?
Is this possible in SQL...?
I personally feel the second approach is probably better and faster, but i'd like a opinion...cuz i've already designed it the first way however i'll redo it if the second is better.
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
OK - the first way is flawed for two reasons:
1. You're relying on the program knowing the names of all the tables.
2. You'd have to change the program if you added a new table.
SO - my solution would be this (_x_ = primary key):
tblCategories ( _ID_, Name )
tblWords ( _ID_, CatID, Word, Description )
Then, to list categories use SELECT * FROM tblCategories.
To list items in a specific category:
SELECT * FROM tblWords WHERE CatID=[your category ID]
To create a new category:
INSERT INTO tblCategories (Name) VALUES ("Test")
because ID would be an autonumber. You get the idea anyway, and that's properly normalised too.
--
Andrew.
|
|
|
|
|
Thanx for the response...
I've re-done what I originally had into something like
Table
==================================
ID - Category - Word - Description
Not quite what you've suggested, but is it not similar and atleast better than my first approach...?
Thanx again!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I have to admit I'm at a loss here. I need to connect to Sybase. Does any one know where I can get a detailed list of providers? Suerly I'm not the first person to run into this problem.
|
|
|
|
|
I love the following link, it contains almost every type of connection string example available in ADO:
Connections
HTH
Nick Parker
|
|
|
|
|
Hi guys, is it possible to create a sproc that takes for example a table name and a column name and then performs a SELECT using those input parameters? If so how can I do this and still be able to pass back a return status based on the results of the SELECT statement?
Regards
Senkwe
Just another wannabe code junky
|
|
|
|
|
Take a look at sp_executesql in Books Online. I use it to execute arbitrary sql statements in some of my stored procs. Not sure what status you get back besides success or failure though.
I think a straight EXECUTE or EXEC may also do the trick.
Bruce Duncan CP#9088, CPUA 0xA1EE, Sonork 100.10030 Hi everyone. My name's Bruce. And I suffer from VB.
|
|
|
|
|
thanks!
Senkwe
Just another wannabe code junky
|
|
|
|
|
Hi..
How can I create UDL(Universal Data Links)files programmaticaly without invoking the OLEDB Data Link Config Dialog? I already have the string connection used to connect the database. I´m using only ODBC...
Thanks.
|
|
|
|
|
Hi,
in Oracle 8.1.6 I have stored procedure:
MY_PROCEDURE( my_cursor OUT ref_cursor_type, param2 IN NUMBER, param3 IN NUMBER) AS
BEGIN
IF param2 = 0 THEN
OPEN my_cursor FOR
SELECT col1, col2, col3 FROM table1 WHERE some_id<=param3;
ELSE
OPEN my_cursor FOR
SELECT col1, col2, col3 FROM table1 WHERE some_id>param3;
END IF;
END;
When I try this (in MSVC++):
ADODB::_RecordsetPtr pRec;
pRec.CreateInstance(__uuidof(ADODB::Recordset));
pRec->Open( "MY_PROCEDURE(NULL,10,10)", _variant_t((IDispatch*)m_pConnection,true),
ADODB::adOpenForwardOnly, ADODB::adLockReadOnly, ADODB::adCmdUnknown);
while ( !pRec->adoEOF )
{
...do something...
}
pRec->Close();
I can't enter while block because pRec is empty.
I can enter while block only when I use:
pRec->Open( "SELECT col1, col2, col3 FROM table1 WHERE some_id<=10", _variant_t((IDispatch*)m_pConnection,true), ADODB::adOpenForwardOnly, ADODB::adLockReadOnly, ADODB::adCmdUnknown);
Why? Where is the problem?
|
|
|
|
|
|
I am not very familar with Microsoft Access,but it seems that when you encrypt a access file(in menu tool->security),you needn't enter a username.Now the problem come:
In VB6.0,how can i connect to such a encrypted file?By data control,i didn't find any property related to database security;by ADO,the connection string shall contain a username,but what's the username to such a file?I tried leave it empty,but it caused a error
|
|
|
|
|
I don't know about VB6,I'm VC guy,but in VC I can pass only file name for connection string:
"DataSource=...\\filepath"
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
|
|
|
|
|
in ConnectionString you just tell the filename,but you still pass without "invalid password" error?(that's what i met in my application)
what object of ADO you use? connection or recordset in VC?
|
|
|
|
|
Anonymous wrote:
what object of ADO you use? connection or recordset in VC?
For connectionstring I use Connection object:
hr = m_pConnection.CreateInstance( __uuidof( Connection ) );
if (SUCCEEDED(hr))
{
hr = m_pConnection->Open(
_bstr_t(L"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db1.mdb;"),
_bstr_t(L""),
_bstr_t(L""),
adModeUnknown);
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
|
|
|
|
|
Do you encrypt with a password?
If so, why not just try "sa,mypwd" in the connection string.
Cheers,
Simon
"I get paid for my brain and my thinking in several obscure worlds", Olli, The Lounge
|
|
|
|
|
Now i have a encrypted file named "db1.mdb" in D:\,and its password,for example,is "codeproject".You mean i shall write like this?
Dim conn As New ADODB.Connection
conn.Provider = "Microsoft.Jet.OLEDB.3.51"
conn.Open "d:\db1.mdb", "sa", "codeproject"
God blessing me...
|
|
|
|
|
Now i have a encrypted file named "db1.mdb" in D:\,and its password,for example,is "codeproject".You mean i shall write like this?
Dim conn As New ADODB.Connection
conn.Provider = "Microsoft.Jet.OLEDB.3.51"
conn.Open "d:\db1.mdb", "sa", "codeproject"
|
|
|
|
|
I need to show a table ( all the table at once) from access database in my Visual basic application.
How I could do it ???
I tried use the Data Form Wizard of VB
But when I fill the Database name- mdb file (by browser) I gets error message :
Unrecognized database format 'myDB.mdb'
|
|
|
|
|
Wow,
Where do I begin, I would suggest getting a book on intro. Visual Basic and make sure that it has ADO database information in one of the chapters. What you are asking is more that just a specific question, but a project. What are you using to display your data? How are you making your connection to the database(ADO, DAO, RDO)? Is there something more specific that you need help with.
This should get you started:
Dim conn as New ADODB.Connection
Dim adors as New ADODB.Recordset
Dim sql as String
sql = "Select * from [YourTableNameHere]"
conn.ConnectionString = [YourConnectionStringHere]
conn.Open
adors.ActiveConnection = conn
adors.Open(sql)
I'm not sure if this helps or not, but I don't think I am fully clear as to your problem.
Nick Parker
|
|
|
|
|
Inside a DTS package I need to execute a self-extracting zip file. I am currently using CreateObject("WScript.Shell") which works when run in VB or executing the DTS package directly. However when a job is used to execute this package the extracted file gets placed to an undetermined directory. So my questions are:
Why does the extracted file get placed in the correct directory when I execute the code and not when a scheduled job runs it?
What can I do to get the scheduled job to extract the file to the correct directory?
I’m stumped on this one any help is greatly appreciated.
Jason W.
|
|
|
|
|
Is there any way SQL server,oracle can talk to each other,perhaps XMl can fit here but how do you pass data generated by oracle in XML to sql server.
Thank you for spending time.
Vineet
|
|
|
|