|
Your parents must be proud that you have reinvented the wheel. Eventually it may even turn.
Go away, I say, go away boy you bother me. -- Foghorn Leghorn
|
|
|
|
|
|
Hey Leppie. The @RETURN_VALUE parameter is auto-created, as you guessed, by SQL Server when you Return something. For Example:
ALTER PROCEDURE uspIsValidUser
@UserName VarChar(20)
AS
BEGIN
IF (SELECT COUNT(*) FROM tblUsers WHERE UserName = @UserName) = 1
BEGIN
SELECT UserName, Address, City, State, ZipCode
FROM tblUsers
WHERE UserName = @UserName
RETURN True
END
ELSE
RETURN False
END
In your code, you can then check the value of @RETURN_VALUE value to see what was returned. It's possible to return datasets at the same time due to the fact that return VALUES are automatically stored in @RETURN_VALUE.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
|
Interesting. You write an app to generate stored procs but still need to ask what @RETURN_VALUE is and what it's for.
|
|
|
|
|
Mark Nischalke wrote:
Interesting. You write an app to generate stored procs but still need to ask what @RETURN_VALUE is and what it's for.
I'm pretty new to the SQL world, so thats why I'm asking... I dont really every have had the need to use it (yeah, I know its a bit more effiecient, but I prefer to do what I know works).[edit]And the fact that VS.NET creates it automatically [/edit]
Can I ask you this? Did you even bother to read the article and download the project? Have you tried it perhaps on a database of your own and see the results?
Cheers
DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET
|
|
|
|
|
I'm not quite interested in reading an article titled "SQL Stored Procedure Wrapper" written by someone who knows nothing about stored procedures.
|
|
|
|
|
Mark Nischalke wrote:
I'm not quite interested in reading an article titled "SQL Stored Procedure Wrapper" written by someone who knows nothing about stored procedures
Thats poor attitude! Who says I know nothing of SP's? YOU, because I dont know what @RETURN_VALUE does, and why it get auto generated by VS.NET. Why not try being a bit helpful, and less ignorant?
And please, being all knowing (as it appears), why not give me an example of the generated @RETURN_VALUE usage? MSDN sure doesnt prove to be helpful (in this aspect).
DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET
|
|
|
|
|
A client is in a bind because one of their contract developers ran off to London with the source code to an Access project.
From what they are telling me they have a directory with an MDB file, some EXEs and setup app. It creates a shortcut icon with a target like this C:\SPP05\MSARN200.EXE C:\SPP05\spp05.mdb /ini C:\WINDOWS\spp05.ini
The client tells me the file is compiled (have not got a hold of it yet) and I was wondering; Can you get into the VBA code as well as the actual database structure? They want some modifications. Does Access ever compile right down to an executable? Or is more of an interpreted type environment?
Sorry for the lack of info and thanks for any help.
Paul Watson Bluegrass Cape Town, South Africa Colin Davies wrote:
...can you imagine a John Simmons stalker !
|
|
|
|
|
Paul Watson wrote:
Can you get into the VBA code as well as the actual database structure? They want some modifications. Does Access ever compile right down to an executable? Or is more of an interpreted type environment?
Paul, from what I remember and what I just checked, most code should be contained inside a module(s) if it is strickly VBA which is in the Database itself for you to look at, however if they actually have an executable then it is more likely a VB app that is making ADO/DAO calls into that particular datbase. The modules inside Access themselves are meant to run within Access. Hope this helps.
Nick Parker
Not everything that can be counted counts, and not everything that counts can be counted. - Albert Einstein
|
|
|
|
|
If I set a password for my Access DB and I try to connect using CCommand, it won't work!
<br />
HRESULT hr;<br />
<br />
CDBPropSet dbinit(DBPROPSET_DBINIT);<br />
<br />
dbinit.AddProperty(DBPROP_AUTH_CACHE_AUTHINFO, true);<br />
dbinit.AddProperty(DBPROP_AUTH_ENCRYPT_PASSWORD, false);<br />
dbinit.AddProperty(DBPROP_AUTH_MASK_PASSWORD, false);<br />
dbinit.AddProperty(DBPROP_AUTH_PASSWORD, OLESTR("pwd"));<br />
dbinit.AddProperty(DBPROP_AUTH_USERID, OLESTR("Admin"));<br />
dbinit.AddProperty(DBPROP_INIT_DATASOURCE, m_sSource );<br />
dbinit.AddProperty(DBPROP_INIT_MODE, (long)19);<br />
dbinit.AddProperty(DBPROP_INIT_PROMPT, (short)4);<br />
dbinit.AddProperty(DBPROP_INIT_PROVIDERSTRING, OLESTR(""));<br />
dbinit.AddProperty(DBPROP_INIT_LCID, (long)1033);<br />
hr = m_db.Open(_T("Microsoft.Jet.OLEDB.4.0"), &dbinit);<br />
if (FAILED(hr))<br />
return hr;<br />
<br />
return m_session.Open(m_db);<br />
I used to do this a hundred times with ASP and password-protected DB with no problem. Why is it like that with CCommand?
Thanks!
|
|
|
|
|
You have to give the password and user in connection string.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
ok... could you be more explicit please?
Thanks for your help!
|
|
|
|
|
I'll search in my codes and send you and example.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
You should set connection to something like this,I use this string in C# but I think it is the same in other places too:(in your 'open' function use this)
"Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:database Password=mypass;User ID=username;Persist Security Info =True;Data Source=myfile.mdb;Jet OLEDB:System Database=E:\\Documents and Settings\\Mazyprogrammer\\Recent.mdw";
Hope it helps.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Hi all,
I have a requirement to convert MS Access queries to Oracle queries.
In MS Access there are pre-defined functions called last, first and Int. I
need to know the oracle equivalent for the above mentioned functions. It
would be great help if u could explain the functions first, last and Int
with small examples.
Best Regards
Venkatraman Kalyanam
Chennai - India
"Being Excellent is not a skill, it is an attitude"
|
|
|
|
|
I need to compare two identically structured tables to get the differences from one of the tables. Any ideas on the easiest/quickest way to do this?
Jason W.
|
|
|
|
|
hello @all,
i have an access data base and a dialogbased program.
to connect the program with the data base i used odbc.
then i add a new class in my project (CRecordset, name: CDatabase) and choose the table i want.
finally i want to register now something into my data base.
I make an object of the data base:
<br />
CDatabase db;<br />
db.Open();<br />
db.Edit();<br />
db.m_x=1;
db.Update();<br />
db.Close();<br />
i get the error in my program, that there is no current data record.
what´s wrong????
Thank you in advance.
|
|
|
|
|
I've tride search after a book about ADO with examples written in C++ but it seems to be impossible!?
Can you help? Is there any ADO books with examples written in C++ and not VBScript/VB?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
I couldn't find one, but it's not hard to convert. That's WHY they write them in VB, because we C++ programmers can do the conversion and the average VB programmer would not cope converting C++ code to VB.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Christian Graus wrote:
I couldn't find one
Why am I not surprised?
Christian Graus wrote:
but it's not hard to convert. That's WHY they write them in VB, because we C++ programmers can do the conversion and the average VB programmer would not cope converting C++ code to VB.
Is it really that easy?
I feel it's not because _variant_t has no similar type in VB? or?
But if the professional says it's possible.... it shold be possible in some way!
Thanks, then I'll buy ADO 2,6 by Wrox. I think that's the best one I've seen!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
I thought the best one was the one from O Reilly, but I am partial to them. They actually have a chapter showing how stuff works in different languages, then the rest is in VB. Wrox books for me are fat with useless code listings.
Rickard Andersson wrote:
I feel it's not because _variant_t has no similar type in VB? or?
VB has no types, does it ? VBScript doesn't.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Christian Graus wrote:
I thought the best one was the one from O Reilly, but I am partial to them. They actually have a chapter showing how stuff works in different languages,
I will check it out. I Like Wrox books but it's pretty true that you say "useless code listings". But I like when it is a little too mucj code that almost nothing!
Christian Graus wrote:
VB has no types, does it ? VBScript doesn't.
Ooogh... okay... I don't know VB that much... I know VBScript has no types!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
If you use the #import "C:\Program Files\Common Files\System\ADO\msado15.dll" method, then C++ use of ADO is almost as easy as using VB.
The ADO wrapper generated is very nice, with this you shouldn't have any problem converting VB code.
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
Hey Mike!
You scared the sh*t out of me!
I thought you had a recomendation of a book about ADO in C++... I've already ordered that book from O´Reilly which Christian suggested me (Which is written in VB)!
Promise me that you'll never do that again!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|