View Single Post
 
Old 05-09-2021, 01:43 AM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,969
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

For starters it looks like the connection string is not right as the DBName appears to run into the UID without a separator.
Let Connect = "driver={sql server};server=SERVERNAME;Database=DBNAME;UID=USRI D;PWD=PASSWOOD;"

Have you actually stepped through the code to see what values are being returned as you go. We don't know anything about the Stored Procedure so have no idea on what the Cmd1 command is doing.

I would note that it appears you are creating a loop to replace the text in a bookmark. The way it is written I would expect the bookmark to disappear on the first write but if it didn't then your code would continue writing there without pause so the resulting code if run to completion would just show the last entry.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote