|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I'm trying to code an Active X Control / Document that will connect to a database which is stored on the web server. I've succesfully coded the whole thing using a local DB What I want to know is how can I connect it to an internet DB ? I've got loads of ADOdc controls in my project, and I've got someone to create a DSN on the web server but I dont know how to connect to it. I cant seem to find the right Data link type when you set up the connection string. I've even tried coding a Custom Property into the Control which I then set to a connection string within the internet explorer container but it didnt work either.......... What is the Microsoft ODBC for internet publishing Data link and why cant I get anything out of it. Can anyone help with this please ? Thanks very much in advance Scott. |
|
#2
|
|||
|
|||
|
What's your db - Access 97, Access 2000, SQLServer 2000, SQL Server 7? If you let me know, I should be able to help you with writing the connection string.
Is the webserver IIS? Last edited by aspnewbie : October 16th, 2002 at 07:10 PM. |
|
#3
|
|||
|
|||
|
Hi,
The DB is an Access 2000 database and the server is a IIS...... Hope you can help ![]() Scott |
|
#4
|
|||
|
|||
|
Hi Scott,
I hope I haven't spoken too soon, now that I reread your email. Is your activeX control within an ASP page? If so, here's the code you would include: Just insert the path for your db in the appropriate spot Dim dcnDB ' CONN object set dcnDB = Server.CreateObject ("ADODB.Connection") dcnDB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;"_ & "Data Source=C:\pathtoyourdb.mdb" dcnDB.Open |
|
#5
|
|||
|
|||
|
ActiveX Control and Database Binding
If you look at the attachment you might get some idea of this control - its a database driven active X control that I want to display in a web page. There are loads of ADOdc controls on it which have connection strings to a database which contains tables which are then bound to fields in the control
The DB is on the web server...... I got the control to work by connecting it to a local DB but I want to make the DB reside on the web server because the users of the control will be accessing it on the intranet I even tried to make a property of the control that would set all the Adodc connection string but it didnt work.... Code:
Public Property Get DataSrc() As Variant DataSrc = Adodc1(10).ConnectionString End Property Public Property Let DataSrc(ByVal vNewValue As Variant) Dim recstring As String recstring = vNewValue Label2(0).Caption = recstring Adodc1(10).ConnectionString = recstring Adodc1(10).Refresh editADO(0).ConnectionString = recstring editADO(0).Refresh editADO(1).ConnectionString = recstring editADO(0).Refresh editADO(2).ConnectionString = recstring editADO(0).Refresh editADO(3).ConnectionString = recstring editADO(0).Refresh editADO(4).ConnectionString = recstring editADO(0).Refresh editADO(5).ConnectionString = recstring editADO(0).Refresh editADO(6).ConnectionString = recstring editADO(0).Refresh AdminADO.ConnectionString = recstring AdminADO.Refresh End Property In this way I was hoping to be able to set the connection string of the ADOdc's after the contol was compiled and sitting in a web page...... I think all I need is the correct connection string for the ADOdc's Scott. |
|
#6
|
|||
|
|||
|
So sorry Scott, I have no idea. I notice there are a couple of postings about connecting to a remote database, but I don't think that's what you're exactly after either.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > ActiveX Control and Database Binding |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|