Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
New user creation in oracle using vb
Author:
Saptarshi Chaudhuri
E-mail:
Click to e-mail author
Submitted:
8/30/2006
Version:
VB6
Compatibility:
VB6
Category:
Databases
Views:
13518
This code creates a new user in oracle and also grants the specific permission.
Declarations:
Dim cn As ADODB.Connection Dim rs As ADODB.Recordset Dim sql As String
Code:
Private Sub Command1_Click() On Error GoTo Errorfun Set cn = New ADODB.Connection cn.Open "Provider=MSDAORA.1;User ID=system;Password=manager;" sql = "CREATE USER " & Text1.Text & " IDENTIFIED BY " & Text2.Text & "" Set rs = New ADODB.Recordset rs.Open sql, cn MsgBox "NEW USER SUCCESSFULLY CREATED" Text1.Enabled = False Exit Sub Errorfun: MsgBox "The error is " & vbCrLf & Err.Number & vbCrLf & Err.Description End Sub Private Sub Command2_Click() sql = "GRANT CONNECT, RESOURCE, CREATE SESSION TO " & Text1.Text & "" Set rs = New ADODB.Recordset rs.Open sql, cn MsgBox "GRANTS SUCCEEDED" Text2.Enabled = False End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement