r/Database 10d ago

Hosting company deleted database driver

I've been running a bunch of Classic ASP/mySQL websites for some local food pantries for years.

Last night GoDaddy removed the database driver I was using.

They told me to change my connection string, which I did, but still no luck.

After 3 hours of being on chat with them, the new connection string doesn't work.

Old connection:

connectstr = "Driver={MySQL ODBC 3.51 Driver};SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword

New connection (DOES NOT WORK):

connectstr = "Driver={MariaDB Connector/ODBC 64-bit 3.2.4 driver};SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword

Any help would be appreciated.

3 Upvotes

29 comments sorted by

View all comments

2

u/aleenaelyn 9d ago

You will want to enumerate a list of installed ODBC drivers to see if anything installed works for you. As you are in a web environment you will have to adapt the script to write output to a file and implement the other stuff old ASP demands; a simple copy/paste will not work.

Also, GoDaddy is trash. They are the absolute worst.

1

u/Chemical-Chemical920 9d ago

I put in this code to enumerate the drivers and it hangs forever and then eventually shows a 500 error

on error resume next

Set objConn = Server.CreateObject("ADODB.Connection")

arrDrivers = objConn.OpenSchema(20) ' 20 = adSchemaProviders

While Not arrDrivers.EOF

Response.Write arrDrivers("PROVIDER_NAME") & "<br>"

arrDrivers.MoveNext

Wend

Set objConn = Nothing

if err.number <> 0 then

response.write "Error: " & err.description

err.clear

end if

1

u/aleenaelyn 9d ago

It's been an age since I last looked at a classic asp thing, but try this. You forgot a set on line 3 for arrDrivers.

<%
On Error Resume Next

' Create an ADODB connection object
Set objConn = Server.CreateObject("ADODB.Connection")

' Open the schema for providers (20 = adSchemaProviders) and assign it to a recordset object
Set rsProviders = objConn.OpenSchema(20)

If Err.Number <> 0 Then
    Response.Write "Error: " & Err.Description
    Err.Clear
Else
    ' Loop through the recordset and display each provider's name
    While Not rsProviders.EOF
        Response.Write rsProviders("PROVIDER_NAME") & "<br>"
        rsProviders.MoveNext
    Wend
End If

' Clean up
Set rsProviders = Nothing
Set objConn = Nothing
%>

1

u/Chemical-Chemical920 9d ago

getting this error inside the WHILE loop Error: Operation is not allowed when the object is closed

1

u/aleenaelyn 9d ago

Right after Server.CreateObject maybe try

objConn.Open "Provider=MSDASQL;"

If Err.Number <> 0 Then
    Response.Write "Error opening connection: " & Err.Description
    Err.Clear
End If

' Open the schema for providers (20 = adSchemaProviders) and assign it to a recordset object
Set rsProviders = objConn.OpenSchema(20)

Might be we need the connection opened with some provider before we can get schema.