Showing posts with label connect. Show all posts
Showing posts with label connect. Show all posts

Tuesday, March 20, 2012

Reaading and Processing a Recordset from Com object

Hi everybody.

I need help with the next topic.

From a stored procedure in sqlserver, I need to call a com+ dll, this dll connect ot another database diferent to sqlserver y return this dll must return to stored procedure a recordser for ther processing.

I tried with sp_OACreate, sp_OAMethod, sp_OAGetProperty but I did not know how to process a recordset

Thanks

Erik

You can return the recordset data as a multi-dimensional array and this will be streamed to the client. You can use INSERT...EXEC on the server-side to capture the results into a temporary table for example. You can't return the recordset object directly since SQL Server will not know how to process it. See sp_OAMethod topic in BOL for more details.

Monday, March 12, 2012

RDO Connection through VB

Hi,

I am using VB to connect to the database and I am using RDO (Remote Data Objects) for this connectivity.

For security reasons, I am using the userid and password retrieved from a different database to establish the connection to the production server. The password we retrieve is encrypted and the connection program decrypts that and connects.

All is fine so far. But after I connect to the database, in the VB project, in the debug mode, I can see the connection string by accessing the property RdoConnection.Connect.

Is there a way, by which, I could establish the rdoconnection and immediately after that, change the 'Connect' property of that to something else, so that it does not have the actual connection information?

Thanks in advance
RajI don't think so. When you change the connect property, I think you will lose the connection.

You could make the class that holds the RDO object private so that it is not remotely accessible. You should also make the RDO object private to the class, and provide write-only access to the connection string by creating a Let property with no Get property.

RDO 2.0 and Visual Basic 5 application stopped working with SQL Server 2005

We have a legacy application that is still in wide use. It is Visual Basic 5 and RDO 2.0 using ODBC to connect to SQL Server database.

When trying to connect to SQL Server 2005, it can no longer update or insert data. It reads data fine. The error message it gives is 16933, "The cursor does not include the table being modified or the table is not updatable through the cursor."

Has anybody else seen this problem? Any help would be appreciated.

Yes, we've seen this. It's hinted at in the documentation, although none of our examples seemed to exactly match what's documented. In several cases we were able to fix the problem by swapping the "from" table with a join table, but in one case we had to give up on the cursor.

Friday, March 9, 2012

RDC user info

i want to write user info to a table when row deleted on
delete trigger.how can i get user info ?this user is using
query analyzer and connect server via remote desktop
connection. how can i get this user machine name or ip,
thanksThere are system functions that will return that info. Be aware that the
logged in application can optionally set the host information in its
connection string. SQL just reads what the lower levels tell it.
If you want the machine info, use host_name or host_id.
If you want the logged in user info, use system_user or current_user.
Cindy Gross, MCDBA, MCSE
http://cindygross.tripod.com
This posting is provided "AS IS" with no warranties, and confers no rights.

RDC Connection string data

I am using RDC for the Crystal Report 8. I use VB6 and connect to a MSSQL 2000 DB. I currently connect to the database by:

CRReport.Database.Tables(1).SetLogOnInfo sCRServer, sCRDatabase, sCRLogin, sCRPassword

and that works fine, but I would like to be able to pass the Workstation ID(WSID) and App name(APP) like can be done in a standard ado connection string.

i.e.
Cn = "uid=sa;pwd=admin;driver={SQL Server};server=NTSERVER5;WSID=" & Trim(sUserName) & "-" & getUserComputerName() & ";APP=" & App.EXEName & "-" & sServerName & ";database=" & sDatabaseName & ";dsn=,,connection=adConnectAsync"

Any ideas on how to pass that information for crystal to use it, when logging in?I also connected to crystal using :
CRReport.Database.LogOnServerEx "pdssql.dll", sCRServer, sCRDatabase, sCRLogin, sCRPassword, "uid=sa;pwd=admin;driver={pdssql.dll};server=" & sCRServer & ";WSID=" & Trim(sUserName) & "-" & getUserComputerName() & ";APP=" & "CR" & App.EXEName & "-" & sServerName & ";database=" & sDatabaseName & ";dsn=,,connection=adConnectAsync"

but MS SQL in the Prodcess Info, when the report runs stilll doesn't show the WSID and APP information on the server. I passed it above, but??

Any ideas.

thanks,

Dean

Saturday, February 25, 2012

rda localconnection

get the following erroer when trying to connect to local db on ppc both emulator and device

using vb 2005 to create a PPC 2003 appliction

Unknown connection option in connection string: provider.

the error occurs at the following code

rdaPress.LocalConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=\My Documents\newsprint.sdf"

any help would be appreciated

Thanks

GS

Grant - get rid of the Provider= clause. Something like this should suit your needs:

"Data Source='\my documents\newsprint.sdf';Password='';Max Database Size='128';Default Lock Escalation ='100';"

-Darren

rda localconnection

get the following erroer when trying to connect to local db on ppc both emulator and device

using vb 2005 to create a PPC 2003 appliction

Unknown connection option in connection string: provider.

the error occurs at the following code

rdaPress.LocalConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=\My Documents\newsprint.sdf"

any help would be appreciated

Thanks

GS

Grant - get rid of the Provider= clause. Something like this should suit your needs:

"Data Source='\my documents\newsprint.sdf';Password='';Max Database Size='128';Default Lock Escalation ='100';"

-Darren

RDA and sql server mobile database

hi all

in the wireless application, if i use RDA to pull data from SQL server 2005 database.

do i need to code a exernal class for the PDA to connect to the sql server.

RDA pull data trough what medium, wireless or active sync, if i wanna pull data through wireless what should i do.

By the way, how to i create a database in PDA by using sql server mobile?

Hi Kang,

Please visit SQL Server Mobile Books Online for initial understanding and how to program against SQL Mobile @. http://msdn2.microsoft.com/en-us/library/ms173053(en-US,SQL.90).aspx

Thanks,

LaxmI NRO, MSFT, SQL Mobile, Microsoft Corporation

RDA and sql server mobile database

hi all

in the wireless application, if i use RDA to pull data from SQL server 2005 database.

do i need to code a exernal class for the PDA to connect to the sql server.

RDA pull data trough what medium, wireless or active sync, if i wanna pull data through wireless what should i do.

By the way, how to i create a database in PDA by using sql server mobile?

Hi Kang,

Please visit SQL Server Mobile Books Online for initial understanding and how to program against SQL Mobile @. http://msdn2.microsoft.com/en-us/library/ms173053(en-US,SQL.90).aspx

Thanks,

LaxmI NRO, MSFT, SQL Mobile, Microsoft Corporation

Monday, February 20, 2012

RAS error no 756

RAS error no 756

If i m trying to connect my remote server from the dos prompt
by giving the foll syntax ie

rasdial <connection> <user> <password>

its getting connected to my remote server.
but i m facing a problem while i m giving the syntax in qa

xp_cmdshell 'rasdial <connection> <user> <password>'

error detail i m getting is

'Remote Access error 756 - This connection is already being dialed.'
even though there is no connection existing.

could u pl let me know what could be the reason.

On the other side
If i m trying to disconnect after a manual connect from the query analyzer
its working fine ie

xp_cmdshell 'connectionname/disconnect'

immidiatly after this , if i m trying to connect through qa i m getting
the same error no ie 756.
even though there is no connection existing.

is there any command or syntax to know through qa
if there is any existing connection disconnect (RAS Connection) ?In your place, I would be inclined to modularize the approach more (at least to identify your issues, as RAS has been changed between different OS and service packs).

In other words, rather than:

xp_cmdshell 'rasdial <connection> <user> <password>'
xp_cmdshell 'connectionname/disconnect'

Implement something like:

xp_cmdshell 'c:\MyConnectBatchFile.cmd'
xp_cmdshell 'c:\MyDisconnectBatchFile.cmd'

That should allow you to manipulate your OS commands separately. Once you have the OS components operating as desired for your requirements, you can look at imbedding everything directly into the xp_cmdshell execution string again.|||Thanx for the mail.

MyConnectBatchFile.cmd how to use this command can u pl explain me better.

I m using win-2k server.

xp_cmdshell 'c:\MyConnectBatchFile.cmd'
xp_cmdshell 'c:\MyDisconnectBatchFile.cmd'|||Originally posted by ranjan
Thanx for the mail.

Q1 MyConnectBatchFile.cmd how to use this command can u pl explain me better.

I m using win-2k server.

xp_cmdshell 'c:\MyConnectBatchFile.cmd'
xp_cmdshell 'c:\MyDisconnectBatchFile.cmd'

A1 Yes, I think so (see below, later).

Use Notepad to create a new text file. Copy and paste (or retype) everything normally typed into a "DOSprompt command line window" into the text file. Rename the file something like 'c:\MyConnectBatchFile.cmd'.

Verify that the MyConnectBatchFile.cmd functions correctly (as you expect) by running it interactively (double clicking on it).

Note: A pause or other interactive dos command left in a .cmd file (for testing, etc.) will cause exec xp_cmdshell 'c:\MyConnectBatchFile.cmd' to appear to 'hang'. It will never get input to continue, and the process will then have to be killed (in taskmanager)!!

Once MyConnectBatchFile.cmd functions as expected interactively; call it from QA, using xp_cmdshell. For example:
exec xp_cmdshell 'c:\MyConnectBatchFile.cmd'