database programming
hi members
i created an application in visual basic 6.0
and want 2 use oracle or ms sql server 2000 as the backend. pls how do i integrate both database with the application i created
Networks
hi members
i created an application in visual basic 6.0
and want 2 use oracle or ms sql server 2000 as the backend. pls how do i integrate both database with the application i created
by kaceyboi Accepted solution
by slayer_ Accepted solution
And just build a connection string with the driver you want to use.
Dim objConn As Object
Dim sConn As String
Set objConn = CreateObject("ADODB.Connection")
sConn = "driver={[Driver Name here]};server=[Server name here];uid=[User ID here];pwd=[Password Here];database=[Database here]"
objConn.ConnectionString = sConn
objConn.Open
At this point, use a record set object to play with your data
by tony hopkinson Accepted solution
Once you've set up the connectionstring, to connect to one or the other. PS you need to pick some way of doing that. Read from a config file, command line or whatever.
It then all depends on your SQL. If it's all fairly basic stuff you should be OK. If you are relying on proprietry data types of extensions to SQl, you might have to mess about a bit.
If what you need is too different. Ship all the database stuff into a dll. Get that working then copy it and make another version for the other database.
Don't be tempted to start doing
if Oracle
else
endif
all over the place.
This discussion is closed to new replies.
Sort by Trending