Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack Thread Tools Search this Thread Display Modes
Old 30-10-2006, 06:40 PM   #1 (permalink)
Mad and Furious
 
redhat's Avatar
 
Join Date: May 2006
Location: Visual Basic 6.0
Posts: 453
Post Help in Database connectivity in VB 6.0


Hi Guys,
I am currently working on a aproject in VB 6.0. I am connecting VB to SQL 2000 using the ADODC recordset. I want to enter values into the database table, via a SQL string. Please tell me how to do this. I am new to VB and wil require a small explanation. But that will do.
redhat is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 31-10-2006, 03:31 PM   #2 (permalink)
Right Off the Assembly Line
 
sweetricha07's Avatar
 
Join Date: Aug 2006
Location: Pune
Posts: 10
Default Re: Help in Database connectivity in VB 6.0

I have no ideas about d/b connectivity in SQL 2000 but I did a project connecting VB 6.0 with Oracle 8i. If you want i can help you with that.
sweetricha07 is offline  
Old 31-10-2006, 04:38 PM   #3 (permalink)
Right Off the Assembly Line
 
Join Date: Oct 2005
Posts: 22
Default Re: Help in Database connectivity in VB 6.0

ignore the winsock parts in the code...
if u dont understand anything i ll explain


Dim s As String
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Winsock1(Index).GetData s, vbString
db = Split(s, "~~")(0)
op = Split(s, "~~")(1)
roll = Split(s, "~~")(2)
nam = Split(s, "~~")(3)
marks = Split(s, "~~")(4)
If op = "add" Then
If db = "oracle" Then
con.Open orastr, "adi", "adi"
Dim a As String
a = "insert into student values (" & roll & "," & nam & "," & marks & ")"
rs.Open a, con
con.Close
Winsock1(Index).SendData ("Success")
ElseIf db = "access" Then
con.Open accstr
Dim ab As String
ab = "insert into student values ('" & roll & "','" & nam & "','" & marks & "')"
rs.Open ab, con
con.Close
Winsock1(Index).SendData ("Success")
End If
ElseIf op = "delete" Then
If db = "oracle" Then
con.Open orastr, "adi", "adi"
Dim abc As String
abc = "delete from student where roll=" & roll
rs.Open abc, con
con.Close
Winsock1(Index).SendData ("Success")
ElseIf db = "access" Then
con.Open accstr
Dim abcd As String
abcd = "delete from student where roll=" & roll
rs.Open abcd, con
con.Close
Winsock1(Index).SendData ("Success")
End If
ElseIf op = "view" Then
If db = "oracle" Then
con.Open orastr, "adi", "adi"
rs.Open "select * from student", con
Winsock1(Index).SendData (rs)
con.Close
ElseIf db = "access" Then
con.Open accstr
rs.Open "student", con
' Winsock1(Index - 1).SendData rs
Winsock1(Index).SendData (rs)
'Winsock1(Index + 1).SendData rs
con.Close
End If

End If
gr8usr is offline  
Old 01-11-2006, 12:17 AM   #4 (permalink)
Resident Fanatic
 
Manshahia's Avatar
 
Join Date: Jul 2006
Location: /Milky way/earth/india/
Posts: 911
Default Re: Help in Database connectivity in VB 6.0

Hey REDHAT,
recently i was also working on a visual basic project.
I downloaded about 150 projects in VB to check how other ppl do the connectivity.
And from all those projects i hav made mine a small and having easy code that can also b learnt very easily.
If u want that project i can send u.
Just mail me ur ID at ravinder_manshahia@yahoo.com
__________________
----------
Manshahia is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Sujeet
- by Krow
- by abhidev
- by topgear

Advertisement




All times are GMT +5.5. The time now is 07:35 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2