|
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
|
|
|
|
|
If you create an XML file from the data in Oracle, you could then create a DTS package in SQL Server to import the data in.
Nick Parker
|
|
|
|
|
I tried text and memo and it doesn't work
please HELP !!!!!
|
|
|
|
|
Do you use visual c++? I can remember that if you use CString for those fields it was ok.
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
|
|
|
|
|
Another question,If you use VC what do use to connect to database and manage it?
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
|
|
|
|
|
|
Sorry,I'm VC guy not VB.When you ask question here I suggest you clarify it.Tell what code you use or another things. I hope another people help you.
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 want put array of 400 byte into a field in Access Table from my VB code .
How ???
|
|
|
|