473,408 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

how to login from VB into sql server

i need help how to login from VB into sql server using sql server account
Jan 11 '07 #1
6 2134
iburyak
1,017 Expert 512MB
1. In VB go to Project – References and check Microsoft ActiveX Data Object 2.1 Library.
2. I made it as simple as possible. Copy following script into any form and hit F5.

[PHP]Option Explicit
Public gConn As New Connection

Private Sub Form_Load()
Dim rRes As New ADODB.Recordset


gConn.Open "Provider=SQLOLEDB;database=dbname;server=serverna me;uid=username;pwd=xxxxx"

Set rRes = gConn.Execute("Select * from sysobjects order by name")

Me.Show

Do While Not rRes.EOF
Print rRes(0)
rRes.MoveNext
Loop


End Sub[/PHP]

Good Luck.
Jan 11 '07 #2
iburyak
1,017 Expert 512MB
Don't forget to change database, server, uid and pwd to yours.
Jan 11 '07 #3
willakawill
1,646 1GB
i need help how to login from VB into sql server using sql server account
You can also create a system DSN and connect through that in VB.
Jan 13 '07 #4
Don't forget to change database, server, uid and pwd to yours.
friend which code u sent me.
i hav done this already...but now i want to create a admin user and employee user of the single database...if admin enter his username and pw so he will hav all rights and if employee enter his identification so limited record will b displayed ,,,,so my question is that...how i create two accounts and from vb how to enter them
Jan 15 '07 #5
iburyak
1,017 Expert 512MB
In connect string you have UID and PWD so you will know who requesting records on the server.
Create two different accounts and with different rights using Enterprise Manager.

You can create restricted view that would be granted to users with restricted rights and revoke all rights directly to tables.
You can use suser_sname() function on server side to check on user name that currently logged in.

Good luck.
Jan 16 '07 #6
thanks
wish u all the best
Jan 17 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Wayne Smith | last post by:
Applies to: Microsoft FrontPage 2000, Microsoft Access 2000, IIS 5.0 Operating System: Microsoft Windows 2000 Professional I am trying to protect a portion of a web site by allowing users to...
2
by: Tom Loach | last post by:
Our system administrator set up an NT server group in order to allow our users to login to our application via https to our sql server. The group appears as a User in SQL Server when you look at...
2
by: Beginner | last post by:
I know this is an old question, but searching all over the internet plus several MS security conferences, still haven't got a straight anwser. Basically, the login.aspx is on one dedicated server...
0
by: John | last post by:
Hi I am using a login in template mode as I have customised it. I have added an image as a 'New User' button using the following code; <a class="button" href="Default2.aspx"> <asp:Image...
0
by: ruju00 | last post by:
I am getting an error in Login() method of the following class FtpConnection public class FtpConnection { public class FtpException : Exception { public FtpException(string message) :...
2
by: Sasquatch | last post by:
I'm having trouble creating a simple login page using the asp:login control. I followed some instructions in a WROX book, "Beginning ASP.NET 2.0," and the instructions are very straight forward,...
1
by: pj | last post by:
I'm trying to redirect users to another page after they Authenticate with the ASP.NET login controls. The user is able to login, but I can't get the response.redirect to work. Can anyone help? ...
0
by: muder | last post by:
I have a standard Login ASP.NET 2.0 control on a login Page, a LoginName and LoginStatus controls on the member's page. once the user login successfully I am redirecting the user to Member.aspx...
3
JamieHowarth0
by: JamieHowarth0 | last post by:
Hi folks, Got a bit of an interesting question. I'm in the process of learning ASP.NET using Microsoft's CTP of Visual Web Studio "Orcas". Part of my classic ASP website incorporates a login...
3
by: satishknight | last post by:
Hi, Can some one tell me how to change the validation sequence for the code pasted below, actually what I want it when any one enters the wrong login information (already registered users) then it...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.