Showing posts with label back. Show all posts
Showing posts with label back. Show all posts

Tuesday, March 6, 2012

Acessing SQL through a DOS login script

Does anybody know if it is possible to pass an NT Environment variable to an SQL Server and then return the results back to the DOS?

Example: when a user logs in, their username is stored in the environment variable %USERNAME%. I would like to send this to SQL and then look up their department and then depending on what department they are in, different drives are mapped.

I think this would be done with stored procedures, but I am quite new to these.

Many thanks in advance
Matt CottrellYes I believe you can, try this from DOS, substring in your login criteria

isql -Uxx -Pxx -Sxx -n -Q"PRINT '%USERNAME%'"

You can then create a stored procedure that "PRINTS" out the drive mapping

"NET USE D: \\Server\Home "

Have your script file pass the USERNAME in then redirect the output to a file and run the file from the DOS command script

Example
isql -Uxx -Pxx -Sxx -n -Q"sp_MakeMappings '%USERNAME%'" -oC:\temp\mapping.cmd

C:\temp\mapping.cmd

del C:\temp\mapping.cmd

Saturday, February 25, 2012

accidentally deleted a table in my local SQL Server how can I get back the table

Hi,

I accidentally deleted a table in my local server. How can I get back the table? I did not do it as a transaction!

Thanks in AdvanceYou need to restore back from your backup if available. There may be third party softwares that allow you to do such operations ...

Friday, February 24, 2012

Access-SQL Serv Autonumber

I have an Access database that was upsized. Access F/E, S2k back. I cannot
update tables that I had to create an index for the upsize. All my queries
come back with "cannot insert null" into index field. Access calls it
Autonumber and we never have to do anything else.
I'm gusssing there is a constraint problem ? Where should I start looking.
Its a primary key field, unique, indenty=1. I thought that defined it as
Autonumber.
Help !You need to set the datatype on the SQL Server to Int. Then check the
checkbox that says 'Identity' field in the Manage indexes dialog.
"Stuart" wrote:

> I have an Access database that was upsized. Access F/E, S2k back. I cannot
> update tables that I had to create an index for the upsize. All my queries
> come back with "cannot insert null" into index field. Access calls it
> Autonumber and we never have to do anything else.
> I'm gusssing there is a constraint problem ? Where should I start looking.
> Its a primary key field, unique, indenty=1. I thought that defined it as
> Autonumber.
> Help !

Access-SQL Serv Autonumber

I have an Access database that was upsized. Access F/E, S2k back. I cannot
update tables that I had to create an index for the upsize. All my queries
come back with "cannot insert null" into index field. Access calls it
Autonumber and we never have to do anything else.
I'm gusssing there is a constraint problem ? Where should I start looking.
Its a primary key field, unique, indenty=1. I thought that defined it as
Autonumber.
Help !
You need to set the datatype on the SQL Server to Int. Then check the
checkbox that says 'Identity' field in the Manage indexes dialog.
"Stuart" wrote:

> I have an Access database that was upsized. Access F/E, S2k back. I cannot
> update tables that I had to create an index for the upsize. All my queries
> come back with "cannot insert null" into index field. Access calls it
> Autonumber and we never have to do anything else.
> I'm gusssing there is a constraint problem ? Where should I start looking.
> Its a primary key field, unique, indenty=1. I thought that defined it as
> Autonumber.
> Help !

Monday, February 13, 2012

Accessing server

Hello all,
Can anyone here help me to solve the following problem?
I have developed an application with vb6.0 as front end and ms
sqlserver as back end.
I have already made .exe and now i want to use my application over the
network.
I tried making a shortcut on the client pc from the main pc or server but
iam getting an errror message.
How can I recity this problem?
How can i use my .exe in client machine where the client should acess
the database which is located on the server?
Pls help me.
Thanks in advance
Regards
Jack
Followup Questions:
What's the error message?
It appears that you have installed the VB6 executable and supporting DLL's
on the server, and then, using a UNC Pathname or a Mapped Drive Letter, you
created a Shortcut on the desktop of the client computer.
Is that how it is?
If the user executes the shortcut, then her system will attempt to load all
the components into memory on the local workstation. If there are SQL Server
components required, they will have to be installed locally.
Also, is the SQL Server set up for Domain/Windows Authentication or SQL
Server Authentication or Mixed Mode?
John
"Jack" <Jack@.discussions.microsoft.com> wrote in message
news:D47E3EA2-BAF0-4D74-BE44-887149735A59@.microsoft.com...
> Hello all,
> Can anyone here help me to solve the following problem?
> I have developed an application with vb6.0 as front end and ms
> sqlserver as back end.
> I have already made .exe and now i want to use my application over the
> network.
> I tried making a shortcut on the client pc from the main pc or server but
> iam getting an errror message.
> How can I recity this problem?
> How can i use my .exe in client machine where the client should acess
> the database which is located on the server?
> Pls help me.
> Thanks in advance
> Regards
> Jack
|||Thanks for the mail.
I think u didnt get what i need.
Its something like this.
My application uses vb6.0 as front end and sql server as backend.
Now i want to install my application on a network that means i want client
computers to access my databse on the server.
Its a simple application nothing complictaed.
Pls help me.
Regards
jack
"John Smith" wrote:

> Followup Questions:
> What's the error message?
> It appears that you have installed the VB6 executable and supporting DLL's
> on the server, and then, using a UNC Pathname or a Mapped Drive Letter, you
> created a Shortcut on the desktop of the client computer.
> Is that how it is?
> If the user executes the shortcut, then her system will attempt to load all
> the components into memory on the local workstation. If there are SQL Server
> components required, they will have to be installed locally.
> Also, is the SQL Server set up for Domain/Windows Authentication or SQL
> Server Authentication or Mixed Mode?
> John
> "Jack" <Jack@.discussions.microsoft.com> wrote in message
> news:D47E3EA2-BAF0-4D74-BE44-887149735A59@.microsoft.com...
>
>
|||Just change the Datasource of connection string to sql server name...
(i think u might using Localhost as datasource now)
recompile it.. copy it to the client computer...