Showing posts with label access. Show all posts
Showing posts with label access. Show all posts

Thursday, March 29, 2012

Create and access database through ftp

I have to create a website and a database, but I 've only access for the server by ftp.

Is there a possibility to create and run some kind of sql script automaticly if I've only have access via ftp?!

(Using sqlserver 2000)

tia john

No, to the best of my knowledge you cannot run a SQL script solely through FTP. Surely your ISP must give you some sort of interface for creating tables?

Thursday, March 22, 2012

create a local (portable) app plus data

We have an Access app that uses tables from an SQL server. Is it possible to
copy the SQL tables localy into the Access mdb file and run the app locally?
What about table relationships? How can I tell if they might be an issue?
Some relationships are built in the diagram tool on the server, and some are
coded into the app itself.
Thanks a heap - Randy
Randy,
Why don't you use MSDE (http://www.microsoft.com/sql/msde/default.mspx )
instead of Access? MDSE is SQL Server, desktop edition, and it is free. This
way you could have exactly the same structure in local databases as you have
on SQL Server.
Dejan Sarka, SQL Server MVP
Mentor
www.SolidQualityLearning.com
"RandyNesst" <RandyNesst@.discussions.microsoft.com> wrote in message
news:1382ED81-4064-4B05-956C-7DD5EF2D08FA@.microsoft.com...
> We have an Access app that uses tables from an SQL server. Is it possible
> to
> copy the SQL tables localy into the Access mdb file and run the app
> locally?
> What about table relationships? How can I tell if they might be an issue?
> Some relationships are built in the diagram tool on the server, and some
> are
> coded into the app itself.
> Thanks a heap - Randy
|||That sounds like a really good idea! I did a little looking around at the
link you gave me, but I have maybe a simple question - what is the process
like to create the MSDE localized database? Just an overview - is it about a
1 hour thing or about a 1 or more day thing? Is there a tool to do it?
Thanks again,
Randy
"Dejan Sarka" wrote:

> Randy,
> Why don't you use MSDE (http://www.microsoft.com/sql/msde/default.mspx )
> instead of Access? MDSE is SQL Server, desktop edition, and it is free. This
> way you could have exactly the same structure in local databases as you have
> on SQL Server.
> --
> Dejan Sarka, SQL Server MVP
> Mentor
> www.SolidQualityLearning.com
> "RandyNesst" <RandyNesst@.discussions.microsoft.com> wrote in message
> news:1382ED81-4064-4B05-956C-7DD5EF2D08FA@.microsoft.com...
>
>
|||Randy,
I am not quite sure whether I understand the question. If you mean the
process of creating a local copy of the server database, it is quite simple:
you can script all objects from the server db in Enterprise Manager and then
execute the script in Query Analyzer on the MSDE, and you have a local copy
with the same structure, but without data. if you need a copy of the data as
well, you can use Data Transformation Services, Merge Replication, ...
Dejan Sarka, SQL Server MVP
Mentor
www.SolidQualityLearning.com
"RandyNesst" <RandyNesst@.discussions.microsoft.com> wrote in message
news:62706E3A-F34B-4ABF-AA75-11600E920014@.microsoft.com...[vbcol=seagreen]
> That sounds like a really good idea! I did a little looking around at the
> link you gave me, but I have maybe a simple question - what is the process
> like to create the MSDE localized database? Just an overview - is it
> about a
> 1 hour thing or about a 1 or more day thing? Is there a tool to do it?
> Thanks again,
> Randy
> "Dejan Sarka" wrote:
|||At this point, you can download SQL Express 2005 (free also) and distro that
with your app.
William Stacey [MVP]
"RandyNesst" <RandyNesst@.discussions.microsoft.com> wrote in message
news:62706E3A-F34B-4ABF-AA75-11600E920014@.microsoft.com...[vbcol=seagreen]
> That sounds like a really good idea! I did a little looking around at the
> link you gave me, but I have maybe a simple question - what is the process
> like to create the MSDE localized database? Just an overview - is it
> about a
> 1 hour thing or about a 1 or more day thing? Is there a tool to do it?
> Thanks again,
> Randy
> "Dejan Sarka" wrote:

create a list if user

Hi there,

Can someone please help me how to generate the list of all "user" in a database and it's access role? really need it . .

Thanks

I am guessing you are looking for the information that is accessible from the following catalog views:

· Sys.database_principals http://msdn2.microsoft.com/en-us/library/ms187328.aspx

· Sys.database_role_members http://msdn2.microsoft.com/en-us/library/ms189780.aspx

· Sys.database_permissions http://msdn2.microsoft.com/en-us/library/ms188367.aspx

I would also like to recommend the following links from BOL:

· Principals http://msdn2.microsoft.com/en-us/library/ms181127.aspx

· Permissions hierarchy http://msdn2.microsoft.com/en-us/library/ms191465.aspx

· Database-level roles http://msdn2.microsoft.com/en-us/library/ms189121.aspx

Hopefully these links will help you find the answer you are looking for.

Please let us know if you have further questions.

Thanks,

-Raul Garcia

SDE/T

SQL Server Engine

|||

Thanks for the quick reply, is there any possbile way I can make a select stament with an out like this (ex only)

User ServerRole DBRole Permission ?

Actully this is my first task in work . . we need this fof auditing purposes . . . Pls help

Raul Garcia - MS wrote:

I am guessing you are looking for the information that is accessible from the following catalog views:

· Sys.database_principals http://msdn2.microsoft.com/en-us/library/ms187328.aspx

· Sys.database_role_members http://msdn2.microsoft.com/en-us/library/ms189780.aspx

· Sys.database_permissions http://msdn2.microsoft.com/en-us/library/ms188367.aspx

I would also like to recommend the following links from BOL:

· Principals http://msdn2.microsoft.com/en-us/library/ms181127.aspx

· Permissions hierarchy http://msdn2.microsoft.com/en-us/library/ms191465.aspx

· Database-level roles http://msdn2.microsoft.com/en-us/library/ms189121.aspx

Hopefully these links will help you find the answer you are looking for.

Please let us know if you have further questions.

Thanks,

-Raul Garcia

SDE/T

SQL Server Engine

Create a linked table in access to SQL server programatically

I'm very sorry to join and ask for help immediately without helping first, but I am at wits end with this.

I need to know how to promatically create a linked table in Microsoft Access 97 to a Microsoft SQL Server 2000 table. The SQL server is set to use trusted connection for authentication. Security is set up correctly because manual creation of the linked table works fine and the table can then be accessed normally. But we have tried many different methods to create this linked table programatically and all have failed.

This Microsoft Access application links tables to both an AS400 and SQL Server 2000 and we are currently using the DoCmd.TransferDatabase function. It works fine to create the linked tables to the AS400 but fails to create the linked table for SQL Server.

The whole purpose of this is because the Access application is coded with a debug mode. At each start, the application destroys linked tables and rebuilds them either locally (debug mode) or to their real homes (live mode).

We have looked at hundreds of knowledge base entries and browsed for nearly 2 days trying to find answers. Please help.

GetutI just opened up an Access97 database and entered this code into a macro
Function CreateLink()
DoCmd.TransferDatabase acLink, "ODBC Database", _
"ODBC;DSN=ATLAS;DATABASE=pubs;Trusted_Connection=Ye s ",_
acTable, "Authors", "dboAuthors"
End Function

Where the DSN = ATLAS is and ODBC connection to SQL Server 2000 on another machine. This code works fine, I ran it and the link was created.

Monday, March 19, 2012

Crash of Enterprise Manager.

Hi,
Every time I try to use enterprise manager it suddenlly crashes.
The server is on, I can access it in other ways but without using
enterprise manager.
I removed sqlserver from the system, and installed it again.
I also installed the service pack 4.
Any hint?
Thanks
Massimo
Hi,
sounds like you have some problems with Microsoft Management Console (MMC).
Danijel Novak
"mappopo" <massimo.petrillo@.gmail.com> wrote in message
news:1135000434.876224.255900@.g14g2000cwa.googlegr oups.com...
> Hi,
> Every time I try to use enterprise manager it suddenlly crashes.
> The server is on, I can access it in other ways but without using
> enterprise manager.
> I removed sqlserver from the system, and installed it again.
> I also installed the service pack 4.
> Any hint?
> Thanks
> Massimo
>
|||What have I to do?
|||Hi,
Try reinstalling MMC from
%CD%:\x86\other\instmmc.exe
%CD% is a letter of SQL Server CD-ROM.
Danijel Novak
"mappopo" <massimo.petrillo@.gmail.com> wrote in message
news:1135065562.406941.165770@.g44g2000cwa.googlegr oups.com...
> What have I to do?
>
|||I already done that.
If I log in (to the machine) as a different user, Enterprise manager
runs well. Only with my account it crashes.
Have you more hints for me?
Thanks for your help.
|||Hi,
It couldbe a problem with profile for this user.
Are other MMC consoles running OK?
Maybe you can try deleting the profile and creating one from the scratch for
this user.
Danijel Novak
"mappopo" <massimo.petrillo@.gmail.com> wrote in message
news:1135098033.010474.95190@.g49g2000cwa.googlegro ups.com...
>I already done that.
> If I log in (to the machine) as a different user, Enterprise manager
> runs well. Only with my account it crashes.
> Have you more hints for me?
> Thanks for your help.
>
|||My profile come from active directory domain. I have no permission to
delete it and create it again.
Other mmc are ok, in effect I use "manage computer" (I hope the
translation is correct, I get it with a right click on "my computer")
to connect to the local instace of sql server.
I am preatty sure that the problem is in some settings but I do noty
know where are those settiongs.
Do you know it?
Thanks

Crash of Enterprise Manager.

Hi,
Every time I try to use enterprise manager it suddenlly crashes.
The server is on, I can access it in other ways but without using
enterprise manager.
I removed sqlserver from the system, and installed it again.
I also installed the service pack 4.
Any hint?
Thanks
MassimoHi,
sounds like you have some problems with Microsoft Management Console (MMC).
--
Danijel Novak
"mappopo" <massimo.petrillo@.gmail.com> wrote in message
news:1135000434.876224.255900@.g14g2000cwa.googlegroups.com...
> Hi,
> Every time I try to use enterprise manager it suddenlly crashes.
> The server is on, I can access it in other ways but without using
> enterprise manager.
> I removed sqlserver from the system, and installed it again.
> I also installed the service pack 4.
> Any hint?
> Thanks
> Massimo
>|||What have I to do?|||Hi,
Try reinstalling MMC from
%CD%:\x86\other\instmmc.exe
%CD% is a letter of SQL Server CD-ROM.
--
Danijel Novak
"mappopo" <massimo.petrillo@.gmail.com> wrote in message
news:1135065562.406941.165770@.g44g2000cwa.googlegroups.com...
> What have I to do?
>|||I already done that.
If I log in (to the machine) as a different user, Enterprise manager
runs well. Only with my account it crashes.
Have you more hints for me?
Thanks for your help.|||Hi,
It couldbe a problem with profile for this user.
Are other MMC consoles running OK?
Maybe you can try deleting the profile and creating one from the scratch for
this user.
--
Danijel Novak
"mappopo" <massimo.petrillo@.gmail.com> wrote in message
news:1135098033.010474.95190@.g49g2000cwa.googlegroups.com...
>I already done that.
> If I log in (to the machine) as a different user, Enterprise manager
> runs well. Only with my account it crashes.
> Have you more hints for me?
> Thanks for your help.
>|||My profile come from active directory domain. I have no permission to
delete it and create it again.
Other mmc are ok, in effect I use "manage computer" (I hope the
translation is correct, I get it with a right click on "my computer")
to connect to the local instace of sql server.
I am preatty sure that the problem is in some settings but I do noty
know where are those settiongs.
Do you know it?
Thanks

Crash of Enterprise Manager.

Hi,
Every time I try to use enterprise manager it suddenlly crashes.
The server is on, I can access it in other ways but without using
enterprise manager.
I removed sqlserver from the system, and installed it again.
I also installed the service pack 4.
Any hint?
Thanks
MassimoHi,
sounds like you have some problems with Microsoft Management Console (MMC).
Danijel Novak
"mappopo" <massimo.petrillo@.gmail.com> wrote in message
news:1135000434.876224.255900@.g14g2000cwa.googlegroups.com...
> Hi,
> Every time I try to use enterprise manager it suddenlly crashes.
> The server is on, I can access it in other ways but without using
> enterprise manager.
> I removed sqlserver from the system, and installed it again.
> I also installed the service pack 4.
> Any hint?
> Thanks
> Massimo
>|||What have I to do?|||Hi,
Try reinstalling MMC from
%CD%:\x86\other\instmmc.exe
%CD% is a letter of SQL Server CD-ROM.
Danijel Novak
"mappopo" <massimo.petrillo@.gmail.com> wrote in message
news:1135065562.406941.165770@.g44g2000cwa.googlegroups.com...
> What have I to do?
>|||I already done that.
If I log in (to the machine) as a different user, Enterprise manager
runs well. Only with my account it crashes.
Have you more hints for me?
Thanks for your help.|||Hi,
It couldbe a problem with profile for this user.
Are other MMC consoles running OK?
Maybe you can try deleting the profile and creating one from the scratch for
this user.
Danijel Novak
"mappopo" <massimo.petrillo@.gmail.com> wrote in message
news:1135098033.010474.95190@.g49g2000cwa.googlegroups.com...
>I already done that.
> If I log in (to the machine) as a different user, Enterprise manager
> runs well. Only with my account it crashes.
> Have you more hints for me?
> Thanks for your help.
>|||My profile come from active directory domain. I have no permission to
delete it and create it again.
Other mmc are ok, in effect I use "manage computer" (I hope the
translation is correct, I get it with a right click on "my computer")
to connect to the local instace of sql server.
I am preatty sure that the problem is in some settings but I do noty
know where are those settiongs.
Do you know it?
Thanks

Crash of Enterprise Manager, strange solution

Hi,
Every time I try to use enterprise manager it suddenlly crashes.
The server is on, I can access it in other ways but without using
enterprise manager.
I removed sqlserver from the system, and installed it again.
I also installed the service pack 4.
I made many attempt to solve the problem.
At last I renamed the file "C:\Program files\Microsoft SQL
Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC", double click
et voila EM runs well again.
Does anyone know why?
Thanks
MassimoHi
I presume copying the MMC back to the original file name MMC still fails? In
which case MMC there must be some configuration information linked to the
file name.
John
"mappopo" wrote:

> Hi,
> Every time I try to use enterprise manager it suddenlly crashes.
> The server is on, I can access it in other ways but without using
> enterprise manager.
> I removed sqlserver from the system, and installed it again.
> I also installed the service pack 4.
> I made many attempt to solve the problem.
> At last I renamed the file "C:\Program files\Microsoft SQL
> Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC", double click
> et voila EM runs well again.
> Does anyone know why?
> Thanks
> Massimo
>|||I think so. Where are those informations?|||Hi
I would have expected it to be in the registry, but searching it didn't seem
to turn up anything!
John
"mappopo" wrote:

> I think so. Where are those informations?
>

Crash of Enterprise Manager, strange solution

Hi,
Every time I try to use enterprise manager it suddenlly crashes.
The server is on, I can access it in other ways but without using
enterprise manager.
I removed sqlserver from the system, and installed it again.
I also installed the service pack 4.
I made many attempt to solve the problem.
At last I renamed the file "C:\Program files\Microsoft SQL
Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC", double click
et voila EM runs well again.
Does anyone know why?
Thanks
Massimo
Hi
I presume copying the MMC back to the original file name MMC still fails? In
which case MMC there must be some configuration information linked to the
file name.
John
"mappopo" wrote:

> Hi,
> Every time I try to use enterprise manager it suddenlly crashes.
> The server is on, I can access it in other ways but without using
> enterprise manager.
> I removed sqlserver from the system, and installed it again.
> I also installed the service pack 4.
> I made many attempt to solve the problem.
> At last I renamed the file "C:\Program files\Microsoft SQL
> Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC", double click
> et voila EM runs well again.
> Does anyone know why?
> Thanks
> Massimo
>
|||I think so. Where are those informations?
|||Hi
I would have expected it to be in the registry, but searching it didn't seem
to turn up anything!
John
"mappopo" wrote:

> I think so. Where are those informations?
>

Crash of Enterprise Manager, strange solution

Hi,
Every time I try to use enterprise manager it suddenlly crashes.
The server is on, I can access it in other ways but without using
enterprise manager.
I removed sqlserver from the system, and installed it again.
I also installed the service pack 4.
I made many attempt to solve the problem.
At last I renamed the file "C:\Program files\Microsoft SQL
Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC", double click
et voila EM runs well again.
Does anyone know why?
Thanks
Massimo
Hi
I presume copying the MMC back to the original file name MMC still fails? In
which case MMC there must be some configuration information linked to the
file name.
John
"mappopo" wrote:

> Hi,
> Every time I try to use enterprise manager it suddenlly crashes.
> The server is on, I can access it in other ways but without using
> enterprise manager.
> I removed sqlserver from the system, and installed it again.
> I also installed the service pack 4.
> I made many attempt to solve the problem.
> At last I renamed the file "C:\Program files\Microsoft SQL
> Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC", double click
> et voila EM runs well again.
> Does anyone know why?
> Thanks
> Massimo
>
|||I think so. Where are those informations?
|||Hi
I would have expected it to be in the registry, but searching it didn't seem
to turn up anything!
John
"mappopo" wrote:

> I think so. Where are those informations?
>

Crash of Enterprise Manager, strange solution

Hi,
Every time I try to use enterprise manager it suddenlly crashes.
The server is on, I can access it in other ways but without using
enterprise manager.
I removed sqlserver from the system, and installed it again.
I also installed the service pack 4.
I made many attempt to solve the problem.
At last I renamed the file "C:\Program files\Microsoft SQL
Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC", double click
et voila EM runs well again.
Does anyone know why?
Thanks
MassimoHi
I presume copying the MMC back to the original file name MMC still fails? In
which case MMC there must be some configuration information linked to the
file name.
John
"mappopo" wrote:
> Hi,
> Every time I try to use enterprise manager it suddenlly crashes.
> The server is on, I can access it in other ways but without using
> enterprise manager.
> I removed sqlserver from the system, and installed it again.
> I also installed the service pack 4.
> I made many attempt to solve the problem.
> At last I renamed the file "C:\Program files\Microsoft SQL
> Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC", double click
> et voila EM runs well again.
> Does anyone know why?
> Thanks
> Massimo
>|||I think so. Where are those informations?|||Hi
I would have expected it to be in the registry, but searching it didn't seem
to turn up anything!
John
"mappopo" wrote:
> I think so. Where are those informations?
>

Sunday, March 11, 2012

CR Out of Memory Error

I am using VB6(SP6) / CR(8.0.1) / WISE INSTALLER(8.1) to distribute a small program. The data is all contained in MS Access 2000 tables and I am using ADO to create each report recordset.

In CR designer I use a TTX file to design the report. This TTX file contains all colums from the recordset and their descriptions i.e. Name, Type, Length and example data.

I create a distribution CD using Wise Installer. Once installed on a Win98, Win2000, Win XP computer everything runs great until the user attempts to run any of the CR reports. On screen the SQL query runs and then calls the CR report. The CR viewer appears and immediately we get an "Out of Memory" error response from CR.

My only remedy is to install MS Office Pro or MS Access 2000-2002. I have use (paid for support) at VB, CR and Wise and received no fix for this problem. VB says it CR, CR says its VB and Wise simply doesn't know?

Thanks in advance for any help on this problem...Maybe you have a memory leak in your VB program?|||Don't think this is the problem... as installing access or office pro solves the problem. This could not fix a memory leak inside the vb program. This problem only occurs if we install to a new computer..

Thanks for your reply

Thursday, March 8, 2012

Cpu Usage High.

Hi,
can we check cpu usage of our server by query analyzer,I dont have direct ac
cess to server and simply i've registered it by entr manager.
Site is too slow..there are no locks no processesing..but still its moving l
ike dead..
i want to check by query analyzer..
1) cpu usage
2) buffer cache ratio
3) ram utilised and free on server.
regards
sunnyHi,
The easiest way is that, you can connect to Performace monitor remotely.
Open Performance monitor and click the ADD counter butter,
where you can mention the SQL server name (\\Servername). But you should
have required OS level previlages in the SQL Server machine.
Buffer hit ratio can verified using the below DBCC command
DBCC PERFMON
Note:
Incase if you found all the hardware resouces usage is below limit than
using profiler identify the TSQL/ Procedure causing
the bottle neck. After that try to tune using SQL Serevr Query execution
plan and Index tuning wizard.
Thanks
Hari
MCDBA
"sunny" <anonymous@.discussions.microsoft.com> wrote in message
news:7EDA9B30-F184-40DD-8FEE-FE144D43D9B8@.microsoft.com...
> Hi,
> can we check cpu usage of our server by query analyzer,I dont have direct
access to server and simply i've registered it by entr manager.
> Site is too slow..there are no locks no processesing..but still its moving
like dead..
> i want to check by query analyzer..
> 1) cpu usage
> 2) buffer cache ratio
> 3) ram utilised and free on server.
> regards
> sunny
>|||can use sp_monitor to check cpu activity since sql was started. . .cpu_busy
column tells you how much time cpu has spent servicing sql server requests

Cpu Usage High.

Hi,
can we check cpu usage of our server by query analyzer,I dont have direct access to server and simply i've registered it by entr manager.
Site is too slow..there are no locks no processesing..but still its moving like dead..
i want to check by query analyzer..
1) cpu usage
2) buffer cache ratio
3) ram utilised and free on server.
regards
sunnyHi,
The easiest way is that, you can connect to Performace monitor remotely.
Open Performance monitor and click the ADD counter butter,
where you can mention the SQL server name (\\Servername). But you should
have required OS level previlages in the SQL Server machine.
Buffer hit ratio can verified using the below DBCC command
DBCC PERFMON
Note:
Incase if you found all the hardware resouces usage is below limit than
using profiler identify the TSQL/ Procedure causing
the bottle neck. After that try to tune using SQL Serevr Query execution
plan and Index tuning wizard.
Thanks
Hari
MCDBA
"sunny" <anonymous@.discussions.microsoft.com> wrote in message
news:7EDA9B30-F184-40DD-8FEE-FE144D43D9B8@.microsoft.com...
> Hi,
> can we check cpu usage of our server by query analyzer,I dont have direct
access to server and simply i've registered it by entr manager.
> Site is too slow..there are no locks no processesing..but still its moving
like dead..
> i want to check by query analyzer..
> 1) cpu usage
> 2) buffer cache ratio
> 3) ram utilised and free on server.
> regards
> sunny
>|||can use sp_monitor to check cpu activity since sql was started. . .cpu_busy column tells you how much time cpu has spent servicing sql server requests

Friday, February 24, 2012

Coverting Access data to SQL query

Hi There
im try to find out if there is a way, of converting an Access db to a .SQL extension file.

I have some web space with a MySQL db attached, and i use phpMyAdmin to update, drop etc the database (i have no direct contact with it). I want all the data in my Access db onto my MySQL db without having to enter each row in. phpMyAdmin can use .SQL files to populate db, but i need to export the Access data into an SQL file format.
CAN ANYONE HELP?

AzureI'd suggest that you use an ETL tool. That makes this process much easier, although it assumes that you can get progmatic access to both of the databases.

If you can get ODBC access to both databases (MS-Access is a "gimme", the MySQL database could be easy or a challenge), then you have lots of choices at very low cost.

You can generate an SQL script from an Access database progmatcially, but it is often quite a bit of work. I'd strongly suggest that you investigate other choices first.

-PatP

Covert Connection from Access to SQL


Edited by haidar_bilal - Please place your code within< code > and < /code > tag. Thank you.

I've got to convert the following functions so it connects to the SQL server that uses this connection string: ("server=(local);database=BCA;Trusted_Connection=yes")

The code below works fine to an Access db. I know I've got to change all the Ole objects below to SQL objects to connect to SQL server. But try as I might, I'm still not getting them right. Can anyone help by showing me how to change the code? Please just take the code and substitute the SQL connection strings for the Access string. That way even I could understand it. Sigh.


Public Class Functions

Public Function GetCommandObject(ByVal strCommand As String, ByVal strPath As String, ByVal ExecuteIt As Boolean) As Data.OleDb.OleDbCommand
Dim objConnection As Data.OleDb.OleDbConnection = GetConnectionObject(strPath)
objConnection.Open()
Dim objCommand As New Data.OleDb.OleDbCommand(strCommand, objConnection)
If ExecuteIt = False Then
Return objCommand
Else
objCommand.ExecuteNonQuery()
End If
objConnection.Close()
End Function

Public Function GetConnectionObject(ByVal strPath As String) As Data.OleDb.OleDbConnection
Dim objConnection As New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strPath)
Return objConnection
objConnection.Close()
End Function

Public Function GetReaderObject(ByVal strCommand As String, ByVal strPath As String) As Data.OleDb.OleDbDataReader
Dim objCommand As Data.OleDb.OleDbCommand = GetCommandObject(strCommand, strPath, False)
Dim objReader As Data.OleDb.OleDbDataReader = objCommand.ExecuteReader(CommandBehavior.CloseConnection)
Return objReader
objReader.Close()
End Function

End Class

www.connectionstrings.com show the connection strings for SQLClient:

Standard Security:

"Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"
- or -
"Server=Aron1;Database=pubs;User ID=sa;Password=asdasd;Trusted_Connection=False"
(booth connection strings produces the same result)

Trusted Connection:

"Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
- or -
"Server=Aron1;Database=pubs;Trusted_Connection=True;"
(booth connection strings produces the same result)

(use serverName\instanceName as Data Source to use an specifik SQLServer instance, only SQLServer2000)
Connect via an IP address:

"Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"
(DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the Data Source is the port to use (1433 is the default))
Declare the SqlConnection:

C#:
using System.Data.SqlClient;
SqlConnection oSQLConn = new SqlConnection();
oSQLConn.ConnectionString="my connectionstring";
oSQLConn.Open();

VB.NET:
Imports System.Data.SqlClient
Dim oSQLConn As SqlConnection = New SqlConnection()
oSQLConn.ConnectionString="my connectionstring"
oSQLConn.Open()

Which one you use depends upon how you want to login. You can use a username and password, or you can use a Trusted Connection, in which case, the ASPNET user on the Web Server must be a user in SQL Server (this is awkward if you are running SQL Server on a machine other than the Web Server.

CountyLong Name and County Short Name

Hello, i have database front end is Access, and backend is sql server. The front end, there are two dropbox, called 'CountyLongName', and 'CountyShortName'. I want to: when i select a countyLongName, there it will pop up the exact CountyShortName in anohter field.

For example, when i click Howard Couty in the 'CountyLongNmae', it will automatically display "HW" in the 'CountyShortName" Field. How can i do that? Thanks.More of an Access question than an SQL question. Also, more of a front-end question than a db question.

That said, the drop-down list has an event called OnChange. In the code for that event, will be something like:

text1.Value = lkpCountyShortName.Column(1)

You must define the query for the lkpCountyShortName to include 2 columns, the first being the short name and the second being the long name.

Regards,

hmscott

Hello, i have database front end is Access, and backend is sql server. The front end, there are two dropbox, called 'CountyLongName', and 'CountyShortName'. I want to: when i select a countyLongName, there it will pop up the exact CountyShortName in anohter field.

For example, when i click Howard Couty in the 'CountyLongNmae', it will automatically display "HW" in the 'CountyShortName" Field. How can i do that? Thanks.|||I usually Dim an array that contains the CountyShortName and populate it in the same loop where I populate the drop-down list. This way the subscript value for each combobox element is the same as the array subscript.

txtShortName.Text = ShortNames_A(cmbLongNames.ListIndex)|||Thanks your guy still remembered me. Last time the backup problem made me crazy. Fortunately everything was recovered.
Do you have any code I can reference,thanks in advance. I am not familar with VBA. I have counties,

Allegany AL
Anne Arundel AA
Baltimore City BC
Baltimore County BA
Calvert CV
Caroline CA
Carroll CR
Cecil CE
Charles CH
Dorchester DO
Frederick FR
Garrett GA
Harford HA
Howard HO
Kent KE
Montgomery MO
Prince George PG
Queen Anne QA
Saint Mary SM
Somerset SO
Talbot TA
Washington WA
Wicomico WI
Worcester -- WO|||Make the Datasource look like

SELECT CountyLongName + ' - ' + CountyShortName FROM yourTable

?????|||I am so sorry, i am still can't figure out how to do it. Can you guy give me more detail. Now i already have a file call "CountyLongName" and CountyShortName". Thanks again!

Tuesday, February 14, 2012

Counting Connections

I have a VB6 program that uses ADO to communicate with a SQL Server database
(and an Access database optionally). Is there a way that I can tell how
many connections that there are at any one time? I'd like to do this to
Access as well if possible?
Rick Ledermanselect count(*) from master.dbo.sysprocesses
where SPID > 50
The 'where SPID > 50' restriction eliminates system connections. I have no
clue how to do this in Access.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Rick Lederman" <rick@.soaringsoftware.com> wrote in message
news:e3wkopEwEHA.3808@.TK2MSFTNGP15.phx.gbl...
> I have a VB6 program that uses ADO to communicate with a SQL Server
database
> (and an Access database optionally). Is there a way that I can tell how
> many connections that there are at any one time? I'd like to do this to
> Access as well if possible?
> Rick Lederman
>|||Goeff,
Thanks, that works great, now to see if I can find how to do it in Access.
Rick
"Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
news:%23MUhVvEwEHA.1984@.TK2MSFTNGP14.phx.gbl...
> select count(*) from master.dbo.sysprocesses
> where SPID > 50
> The 'where SPID > 50' restriction eliminates system connections. I have
no
> clue how to do this in Access.
> --
> Geoff N. Hiten
> Microsoft SQL Server MVP
> Senior Database Administrator
> Careerbuilder.com
> I support the Professional Association for SQL Server
> www.sqlpass.org
> "Rick Lederman" <rick@.soaringsoftware.com> wrote in message
> news:e3wkopEwEHA.3808@.TK2MSFTNGP15.phx.gbl...
> database
>|||"Rick Lederman" <rick@.soaringsoftware.com> wrote in message
news:e3wkopEwEHA.3808@.TK2MSFTNGP15.phx.gbl...
> I have a VB6 program that uses ADO to communicate with a SQL Server
database
> (and an Access database optionally). Is there a way that I can tell how
> many connections that there are at any one time?
By one instance of your application on one computer, or by all copies of
your application on all computers?

> I'd like to do this to Access as well if possible?
With VB6 and ADO you can control the number of connections in use. In
Access, if you use ADO you can also control the connection count in use.
There is absolutely no way to tell how many connections will be used (or are
being used) by Access if you are relying on Jet to manage the database
access. The query that Geoff provided will give you an idea of how many
connections are use at any given time.
Steve|||Try using a Pass-through query in Access to get the info.
-Sue
On Mon, 1 Nov 2004 15:13:53 -0500, "Rick Lederman"
<rick@.soaringsoftware.com> wrote:

>Goeff,
>Thanks, that works great, now to see if I can find how to do it in Access.
>Rick
>"Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
>news:%23MUhVvEwEHA.1984@.TK2MSFTNGP14.phx.gbl...
>no
>

Counter settings?

I'm changing databases for a website from Access to SQl Server.
In the Access file, the ID column is assign as 'counter' so the value is automaticly raised by 1 when 'Insert'-statement is used.
How is the equivalent made for SQL Server?
I get an error message when I use the 'Insert statement'

Thanks
CalleOriginally posted by Calle
I'm changing databases for a website from Access to SQl Server.
In the Access file, the ID column is assign as 'counter' so the value is automaticly raised by 1 when 'Insert'-statement is used.
How is the equivalent made for SQL Server?
I get an error message when I use the 'Insert statement'

Thanks
Calle

Try changing your ID column to an integer and set the Identity property to Yes (not for replication), set seed to 1 and increment to 1.

This is the same as the Autonumber function in Access.|||I think this has already been done. actually this is the reason for the error. you can remove identity property on the target table and do your insert. once it completes you can reestablish identity(1,1). another way would be to set identity_insert your_table_name on before the insert, and then set it off after insert completes. third way would be to exclude the identity field from being populated. but the last method would assign brand new identity values which may break relationship between tables.