I am getting an "Connection must be valid and open" error. After some research I have found two possible reasons for this: malformed sql or bad connection string. Since the error is being thrown on a second .executescalar statement I will assume the connection string is working. I have two questions. First - if I can cut and paste the sql statement into mySql's query browser and it returns the information, is the sql malformed? (e.g. select user_id from cms.accounts where [EMAIL="firstname.lastname@example.org'"]email@example.com'[/EMAIL]) Next - are there other reasons for the error message.
All 3 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.